Skip to content

Possible Race condition in GraphQL schema generation #520

Open
@TinyTrebuchet

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions