Azure / Azure/data-api-builder
[Bug]: GraphQL type doesn't match any entity name or singular type in the runtime config.
- 主要语言
- C#
- 星标
- 1.5k
- 派生
- 370
- 平均合并
- 3 天 22 小时
- 30 天内合并 PR
- 9
描述
### What happened?
A bug happened! (Or I'm doing something wrong)
Error message in Postman
In postman: POST `http://localhost:5000/graphql`
CosmosDB emulator running
schema.gql:
```type Activity @model {
id: String
iothubname: String
Body: Body
SystemProperties: SystemProperties
Properties: Properties
}
type Body {
la_activity_device_mac_date: String
action: String
la_activity_device_mac: String
la_activity_index: Int
la_activity_dev_ref: String
la_activity_block: String
la_activity_activity: String
la_activity_mode: Int
la_activity_tag: String
la_activity_date: String
la_activity_time: String
la_activity_timestamp: Int
la_activity_quantity: Int
}
type SystemProperties {
iothubconnectiondeviceid: String
iothubconnectionauthmethod: String
iothubconnectionauthgenerationid: String
iothubcontenttype: String
iothubcontentencoding: String
iothubenqueuedtime: String
iothubmessagesource: String
}
type Properties {
action: String
}
```
The GraphQL Query in Postman:
```{
activities(filter: { Body: { la_activity_device_mac: {eq: "DCDA0C56FA18"}}}){
items {
id
Body {
la_activity_device_mac_date
la_activity_device_mac
la_activity_index
la_activity_dev_ref
la_activity_tag
la_activity_date
la_activity_time
la_activity_quantity
}
Properties {
action
}
}
}
}
```
This query results in the error message posted below.
If I run a query without a filter as follows, it returns the record.
Query:
```{
activities{
items {
id
Body {
la_activity_device_mac_date
la_activity_device_mac
la_activity_index
la_activity_dev_ref
la_activity_tag
la_activity_date
la_activity_time
la_activity_quantity
}
Properties {
action
}
}
}
}
```
The result:
```{
"data": {
"activities": {
"items": [
{
"id": "843e7f39-a565-4379-ae3b-99f49afba24b",
"Body": {
"la_activity_device_mac_date": "DCDA0C56FA18-2024-03-29",
"la_activity_device_mac": "DCDA0C56FA18",
"la_activity_index": 0,
"la_activity_dev_ref": "am1",
"la_activity_tag": "8D01EF395A",
"la_activity_date": "2024-03-29",
"la_activity_time": "12:24:06",
"la_activity_quantity": 1
},
"Properties": {
"action": "addActivity"
}
}
]
}
}
}
```
Any advice as to what is being done incorrectly?
### Version
Microsoft.DataApiBuilder 0.10.23+573117a7ff19d9d946343a92ad8d0f32e649954c
### What database are you using?
CosmosDB NoSQL
### What hosting model are you using?
Static Web Apps (SWA)
### Which API approach are you accessing DAB through?
GraphQL
### Relevant log output
```Text
{
"errors": [
{
"message": "GraphQL type doesn't match any entity name or singular type in the runtime config.",
"extensions": {
"code": "BadRequest"
}
}
]
}
```
### Code of Conduct
- [X] I agree to follow this project's Code of Conduct
贡献指南
调研方向
使用 Cosmos DB 在 Microsoft.DataApiBuilder 0.10.23 上复现 issue 中经过筛选和未经过筛选的 GraphQL 请求,然后跟踪筛选涉及的 runtime-config entity/type 验证。未指定源文件或测试;完成的标准是确定经过筛选的请求为何拒绝 GraphQL 类型,并添加回归测试或记录已确认的配置错误。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- graphql, postman
- 领域
- api, databases
- Issue 类型
- 缺陷
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 需要澄清
- 新手友好度
- 30/100