Azure / Azure/data-api-builder
[Bug]: GraphQL type doesn't match any entity name or singular type in the runtime config.
- Dominant language
- C#
- Stars
- 1.5k
- Forks
- 370
- Avg merge
- 3d 22h
- Merged PRs (30d)
- 9
Description
### 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
Contributor guide
Research direction
Reproduce the filtered and unfiltered GraphQL requests from the issue against Microsoft.DataApiBuilder 0.10.23 with Cosmos DB, then trace the runtime-config entity/type validation involved in the filter. No source file or test is named; done means determining why the filtered request rejects the GraphQL type and adding a regression test or documenting the confirmed configuration error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- graphql, postman
- Domain
- api, databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100