Open NfNitLoop opened 3 years ago
Interesting, we don't typically use the schema definition like that. What's the use case?
What's the use case?
In general, following the GraphQL spec? 😅
In particular, Shopify's GraphQL API uses QueryRoot and MutationRoot as root objects.
Can confirm this is still an issue, I just ran into this in another GraphQL API.
It's definitely a part of the GraphQL spec as defined in https://spec.graphql.org/June2018/#sec-Schema
Expected behavior
gradle generateJava
should inspect theschema
block for a schema to determine the Root Operation Types for the schema.Actual behavior
The generator seems to just look for default operation types
Query
andMutation
. (I have not testedSubscription
.) It completely ignores theschema
block.Steps to reproduce
With a build.gradle like this:
run
gradle generateJava
against a schema like this:I'd expect to get query classes for QueryRoot and MutationRoot but get neither.
However, if we modify the root type names to be the defaults, like this:
The
SetStringsGraphQLQuery
andStringsGraphQLQuery
classes do get generated.