Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: GraphQL type doesn't match any entity name or singular type in the runtime config. #2155

Open
1 task done
wreyford opened this issue Apr 7, 2024 · 2 comments
Open
1 task done
Labels
bug Something isn't working triage issues to be triaged

Comments

@wreyford
Copy link

wreyford commented Apr 7, 2024

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:

  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

{
    "errors": [
        {
            "message": "GraphQL type doesn't match any entity name or singular type in the runtime config.",
            "extensions": {
                "code": "BadRequest"
            }
        }
    ]
}

Code of Conduct

  • I agree to follow this project's Code of Conduct
@wreyford wreyford added bug Something isn't working triage issues to be triaged labels Apr 7, 2024
@wreyford
Copy link
Author

wreyford commented Apr 9, 2024

Our data is ingested from IoT Hub, thus the nested structure. We have no choice but to use as above.
When will DAB to CosmosDB, where we heavily rely on nested data in containers to limit our RU's, allow a basic filter on data in a nested 'Body{}' (where all the sensible data resides in our case) be available. I see MS has been working on this limitation since Feb 2023. I really cannot understand that you do not cater for nested data queries (especially for CosmosDB-nosql) where it is strongly advised.

@wreyford
Copy link
Author

In the repository: src/Service.Tests/CosmosTests/QueryFilterTests.cs
There are some very complex nested filters. Do these tests pass on CosmosDb, and if so, why is my example above failing.
Any help will be appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage issues to be triaged
Projects
None yet
Development

No branches or pull requests

1 participant