-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Description
Seems like neither GraphQLTypeCollectingVisitor nor GraphQLTypeResolvingVisitor visit directive arguments at all.
As a result, a type that is used in directive arguments only does not become a part of the schema i.e. schema.getTypeMap() will not contain it.
Neither will a type reference used in a directive argument get replaced.
Here's a quick example:
GraphQLSchema schema = GraphQLSchema.newSchema()
.query(GraphQLObjectType.newObject()
.name("Query")
.field(GraphQLFieldDefinition.newFieldDefinition()
.name("test")
.type(Scalars.GraphQLString)
.argument(GraphQLArgument.newArgument()
.name("in")
//Gets replaced as expected
.type(new GraphQLTypeReference("String"))
)
.dataFetcher(env -> "test")
.withDirective(GraphQLDirective.newDirective()
.name("auth")
.argument(GraphQLArgument.newArgument()
.name("role")
//Does *not* get replaced
.type(new GraphQLTypeReference("String"))
.value("Admin")
)
)
)
)
.build();Metadata
Metadata
Assignees
Labels
No labels