Skip to content

GraphQLTypeReference should implement GraphQLUnmodifiedType? #9

@Hellblazer

Description

@Hellblazer

I have a schema that uses GraphQLTypeReference for the usual reasons. When I go to execute a query against that schema that references a field that does not exist, I see:

java.lang.ClassCastException: graphql.schema.GraphQLTypeReference cannot be cast to graphql.schema.GraphQLUnmodifiedType
    at graphql.schema.SchemaUtil.getUnmodifiedType(SchemaUtil.java:33)
    at graphql.schema.SchemaUtil.isLeafType(SchemaUtil.java:15)
    at graphql.validation.rules.ScalarLeafs.checkField(ScalarLeafs.java:21)
    at graphql.validation.RulesVisitor.checkField(RulesVisitor.java:92)
    at graphql.validation.RulesVisitor.enter(RulesVisitor.java:51)
    at graphql.validation.LanguageTraversal.traverseImpl(LanguageTraversal.java:19)
    at graphql.validation.LanguageTraversal.traverseImpl(LanguageTraversal.java:22)
    at graphql.validation.LanguageTraversal.traverseImpl(LanguageTraversal.java:22)
    at graphql.validation.LanguageTraversal.traverseImpl(LanguageTraversal.java:22)
    at graphql.validation.LanguageTraversal.traverseImpl(LanguageTraversal.java:22)
    at graphql.validation.LanguageTraversal.traverseImpl(LanguageTraversal.java:22)
    at graphql.validation.LanguageTraversal.traverse(LanguageTraversal.java:14)
    at graphql.validation.Validator.validateDocument(Validator.java:20)
    at graphql.GraphQL.execute(GraphQL.java:66)
    at graphql.GraphQL.execute(GraphQL.java:50)
    at graphql.GraphQL.execute(GraphQL.java:42)

I'm using version 1.2 from the maven repo. I cloned the current state of master, built that, and get the same error.

What's particularly odd is that this is intermittent. I can run sometimes the same test with no changes and immediately after failing it will succeed. So I'm guessing there is some hash ordering diffs between runs that cause this to occasionally work.

So... Is GraphQLTypeReference supposed to implement GraphQLUnmodifiedType, or am I doing something wrong with my GraphQLTypeReferences?

Thanks. This is a wonderful library.

Metadata

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