You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is good, because (as I learned), the GraphQL spec requires a Query type but you can't define an emptytype Query or type Query {} because all object types must have at least one field. Short of adding a fake field that would clutter the schema, having the introspection query tack on a Query object is a good idea!
HOWEVER, I'm getting an error in Postman:
This seems to be caused by "fields": null. As a workaround, I modified our code to patch that to be "fields": [] and the error goes away. (see hypermodeinc/modus#558)
I dug through the GraphQL Go Tools sources, but I really can't seem to find where the Query type is being added. Any ideas? Happy to send a PR if you can point me in the right direction. Thanks.
The text was updated successfully, but these errors were encountered:
Consider a schema that contains only mutations:
In such cases, it appears that an empty root
Query
object is being added to the results of the introspection queries:This is good, because (as I learned), the GraphQL spec requires a Query type but you can't define an empty
type Query
ortype Query {}
because all object types must have at least one field. Short of adding a fake field that would clutter the schema, having the introspection query tack on aQuery
object is a good idea!HOWEVER, I'm getting an error in Postman:
This seems to be caused by
"fields": null
. As a workaround, I modified our code to patch that to be"fields": []
and the error goes away. (see hypermodeinc/modus#558)I dug through the GraphQL Go Tools sources, but I really can't seem to find where the
Query
type is being added. Any ideas? Happy to send a PR if you can point me in the right direction. Thanks.The text was updated successfully, but these errors were encountered: