graphql-java-tools icon indicating copy to clipboard operation
graphql-java-tools copied to clipboard

GraphQLSchema object created without custom directives

Open marmys opened this issue 6 years ago • 1 comments

Hi.

When custom directive is declared in schema, for instance

directive @notsortable on FIELD_DEFINITION

then expected behaviour is that this directive will be in GraphQLSchema object.

This does not happen with graphql-java-tools library. What happens is that GraphQLSchema object is created only with default directives ("include", "skip")

In graphql-java it works as expected. When custom direcitve is added then GraphQLSchema object has it in it's directives set.

This is a problem when other libraries depend on stuff that is present in GraphQLSchema object. Like for instance federation-jvm https://github.com/apollographql/federation-jvm This library adds additional query that should return schema as a string. Response is build based on GraphQLSchema object. When GraphQLSchema object does not contain directive definition then produced schema string contains invalid schema without directive definition.

marmys avatar Aug 21 '19 09:08 marmys

I agree this would be a good addition.

vojtapol avatar Feb 04 '20 15:02 vojtapol