Possible Race condition in GraphQL schema generation #520
Open
Description
The graphql-spqr library assumes that interfaces can only be implemented by classes that resolve to GraphQLObjectType
. If a Java Enum implements an interface and is discovered via its interface, it resolves to GraphQLEnumType
and is stored in typeCache
but is not added to discoveredTypes
as it is not a GraphQLObjectType
. This can result in a schema tree where no nodes actually contain the correct GraphQLEnum
type mapping for the Java Enum, and are just resolved to GraphQLTypeReference
This creates a race condition: when an enum is resolved directly as a field/argument/return type, it is correctly represented, but if resolved via its interface, it fails to appear.
Metadata
Assignees
Labels
No labels