GraphQL naming conventions #1479
Replies: 3 comments 7 replies
-
Hi @rodyvansambeek, thanks for spotting this. At the moment, the fields generated does have the same styling/casing as the column names by default. If a column name is camel Cased, it does show up like that in the graphql field as well.
the fields for the graphql query are as follows {
stocks {
items{
pieceid
categoryName
piecesAvailable
piecesRequired
}
}
} Notice that the fields However, by making use of the In the config file, under the "mappings": {
"pieceid": "pieceId"
} GraphQL query: {
stocks {
items{
pieceId
categoryName
piecesAvailable
piecesRequired
}
}
} Please refer to Mappings documentation for more information on |
Beta Was this translation helpful? Give feedback.
-
Something doesn't seem right with the GraphQL that is being generated. As you pointed out, we reference the GraphQL naming style guide in the source code, here to be exact: https://github.com/Azure/data-api-builder/blob/main/src/Service.GraphQLBuilder/GraphQLNaming.cs#L188-L193 Now that method, when executed like If you're seeing a generated GraphQL graph that doesn't match that, then I think we have a bug in how the names are generated. |
Beta Was this translation helpful? Give feedback.
-
I have opened the Draft Pull Request #1528, let's continue our conversion there. |
Beta Was this translation helpful? Give feedback.
-
I am using DAB to connect to a MSSQL database, and in MSSQL it is common for Tables and Properties to be PascalCase.
However in the GraphQL naming conventions which is actually referenced from the source code I would think that the resulting GraphQL fields should also be camelCase.
In my MSSQL database I have a table called Properties, with columns: "Id" and "Description".
The graphql query to fetch these is:
Wheren Properties is nicely camelCased, but shouldn't Id and Description be camelCased as well?
Beta Was this translation helpful? Give feedback.
All reactions