Class GraphQLDirective

java.lang.Object
graphql.schema.GraphQLDirective
All Implemented Interfaces:
GraphQLNamedSchemaElement, GraphQLSchemaElement

@PublicApi public class GraphQLDirective extends Object implements GraphQLNamedSchemaElement
A directive can be used to modify the behavior of a graphql field or type.

See http://graphql.org/learn/queries/#directives for more details on the concept.

A directive has a definition, that is what arguments it takes, and it can also be applied to other schema elements. Originally graphql-java re-used the GraphQLDirective and GraphQLArgument classes to do both purposes. This was a modelling mistake. New GraphQLAppliedDirective and GraphQLAppliedDirectiveArgument classes have been introduced to better model when a directive is applied to a schema element, as opposed to its schema definition itself.