-
Notifications
You must be signed in to change notification settings - Fork 316
Open
Labels
Description
What happened?
When adding the fields array (with name, description, and primary-key properties) to entities in dab-config.json, all GraphQL queries return HTTP 500 error.
REST endpoints continue to work normally. The GraphQL schema fails to initialize entirely — even { spools(first: 1) { items { spoolId } } } returns 500.
This was happening on the 1.7.86-rc, so I updated to 1.7.90 and it's still occurring.
To Reproduce:
- Add a
fieldsarray to any table entity indab-config.json:
{
"entities": {
"Project": {
"source": {
"object": "dbo.Projects",
"type": "table"
},
"fields": [
{ "name": "projectId", "description": "Primary key", "primary-key": true },
{ "name": "projectName", "description": "Display name of the project" }
],
"graphql": {
"enabled": true,
"type": { "singular": "Project", "plural": "Projects" }
},
"permissions": [{ "role": "authenticated", "actions": [{ "action": "read" }] }]
}
}
}- Start DAB and send any GraphQL query
- Observe: HTTP 500,
No primary key defined and conventions couldn't locate a fallback - Remove the
fieldsarray — GraphQL works again
The fields array is useful for providing field descriptions for the describe-entities tool. Currently, removing fields is the only workaround to restore GraphQL, which means losing those MCP field descriptions.
Version
1.7.90
What database are you using?
Azure SQL
What hosting model are you using?
Container Apps
Which API approach are you accessing DAB through?
GraphQL
Relevant log output
Azure.DataApiBuilder.Service.Exceptions.DataApiBuilderException: No primary key defined and conventions couldn't locate a fallback
at Azure.DataApiBuilder.Service.GraphQLBuilder.GraphQLUtils.FindPrimaryKeyFields(ObjectTypeDefinitionNode node, DatabaseType databaseType)
at Azure.DataApiBuilder.Service.GraphQLBuilder.Queries.QueryBuilder.GenerateByPKQuery(...)
at Azure.DataApiBuilder.Service.GraphQLBuilder.Queries.QueryBuilder.Build(...)
Code of Conduct
- I agree to follow this project's Code of Conduct
Reactions are currently unavailable