I’m using the graphql-platform as a client library to create entities in a space. This library works by code-generating type-safe C# code from the queries and the schema for the space.
One side effect of this is that the library always injects a __typename field at every level of the query. This means that I can’t run any queries since it’s not supported on the top field.
Example minimal mutation:
mutation Test {
supportTickets {
__typename
}
}
response:
{
"errors": [
{
"message": "Operation [__typename] is not found for SupportSupportTicket",
"locations": [
{
"line": 86,
"column": 3
}
],
"path": [
"supportTickets"
]
}
],
"data": {
"supportTickets": null
}
}
The library authors have said a long time ago that this field is required by the GraphQL spec, and I don’t have a way to disable this field during code-generation: Allow Strawberry Shake to remove __typename from queries · Issue #3565 · ChilliCream/graphql-platform · GitHub
Is there a reason why the __typename field is not supported at this level? It seems to work on all other levels.