Directives

Type System Directives

 

Executable Directives

Query, Mutation & Subscription Directives

directive @example on QUERY

query example @example { ... }
directive @example on MUTATION

mutation example @example { ... }
directive @example on SUBSCRIPTION

subscription example @example { ... }

Field Directives

directive @example on FIELD

query {
    example @example {
        ...
    }
}

Fragment Definition Directives

directive @example on FRAGMENT_DEFINITION

fragment example on Example @example {
    ...
}

Fragment Spread Directives

directive @example on FRAGMENT_SPREAD

fragment example on Example { ... }

query {
    ... on Query @example { ... }
    ... example @example { ... }
}

Variable Definition Directives

directive @example on VARIABLE_DEFINITION

query example($example: Int! @example) { ... }