Skip to content

TypeReferences not resolved in schema applied directives #3053

@kaqqao

Description

@kaqqao

Describe the bug
If an applied directive on the schema itself has a type reference, it stays unresolved.

To Reproduce

@Test
public void testRef() {
        GraphQLSchema schema = GraphQLSchema.newSchema()
                .query(newObject()
                        .name("query")
                        .field(echo -> echo
                                .name("echo")
                                .type(Scalars.GraphQLString)))
                .additionalDirective(newDirective()
                        .name("cache")
                        .argument(enabled -> enabled
                                .name("enabled")
                                .type(Scalars.GraphQLBoolean))
                        .build())
                .withSchemaAppliedDirectives(GraphQLAppliedDirective.newDirective()
                        .name("cache")
                        .argument(enabled -> enabled
                                .name("enabled")
                                .type(GraphQLTypeReference.typeRef(Scalars.GraphQLBoolean.getName()))
                                .valueLiteral(new BooleanValue(true)))
                        .build())
                .build();
        assertFalse(schema.getSchemaAppliedDirective("cache").getArgument("enabled").getType() instanceof GraphQLTypeReference);
}

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