Spring Boot GraphQL Directive

GraphQL provides a Directive to support extensions of scheme declarations. Directives are used to provide additional functionality at run time.

Directives are majorly divided into 2 parts Schema and Operations. Both are declared with the @ symbol and followed by a list of arguments where the Directive is applicable separated by the | symbol as below.

FIELD_DEFINITION | ARGUMENT_DEFINITION | INPUT_FIELD_DEFINITION | ENUM_VALUE

The Directive location determines whether it will work as a Schema or Operational Directive. GraphQL provides @skip and @include Operation Directives and @deprecated and @specifiedBy Schema directive.

 

follow us on