Package graphql

Class Directives

java.lang.Object
graphql.Directives

@PublicApi @NullMarked public class Directives extends Object
The directives that are understood by graphql-java
  • Field Details

    • DEPRECATED_DIRECTIVE_DEFINITION

      public static final DirectiveDefinition DEPRECATED_DIRECTIVE_DEFINITION
    • INCLUDE_DIRECTIVE_DEFINITION

      public static final DirectiveDefinition INCLUDE_DIRECTIVE_DEFINITION
    • SKIP_DIRECTIVE_DEFINITION

      public static final DirectiveDefinition SKIP_DIRECTIVE_DEFINITION
    • SPECIFIED_BY_DIRECTIVE_DEFINITION

      public static final DirectiveDefinition SPECIFIED_BY_DIRECTIVE_DEFINITION
    • ONE_OF_DIRECTIVE_DEFINITION

      @ExperimentalApi public static final DirectiveDefinition ONE_OF_DIRECTIVE_DEFINITION
    • DEFER_DIRECTIVE_DEFINITION

      @ExperimentalApi public static final DirectiveDefinition DEFER_DIRECTIVE_DEFINITION
    • EXPERIMENTAL_DISABLE_ERROR_PROPAGATION_DIRECTIVE_DEFINITION

      @ExperimentalApi public static final DirectiveDefinition EXPERIMENTAL_DISABLE_ERROR_PROPAGATION_DIRECTIVE_DEFINITION
    • BOOLEAN

      public static final String BOOLEAN
      See Also:
    • STRING

      public static final String STRING
      See Also:
    • NO_LONGER_SUPPORTED

      public static final String NO_LONGER_SUPPORTED
      See Also:
    • DeferDirective

      @ExperimentalApi public static final GraphQLDirective DeferDirective
      The @defer directive can be used to defer sending data for a fragment until later in the query. This is an opt-in directive that is not available unless it is explicitly put into the schema.

      This implementation is based on the state of Defer/Stream PR More specifically at the state of this commit

      The execution behaviour should match what we get from running Apollo Server 4.9.5 with graphql-js v17.0.0-alpha.2

    • IncludeDirective

      public static final GraphQLDirective IncludeDirective
    • SkipDirective

      public static final GraphQLDirective SkipDirective
    • DeprecatedDirective

      public static final GraphQLDirective DeprecatedDirective
      The "deprecated" directive is special and is always available in a graphql schema

      See the GraphQL specification for @deprecated

    • SpecifiedByDirective

      public static final GraphQLDirective SpecifiedByDirective
      The "specifiedBy" directive allows to provide a specification URL for a Scalar
    • OneOfDirective

      @ExperimentalApi public static final GraphQLDirective OneOfDirective
    • ExperimentalDisableErrorPropagationDirective

      @ExperimentalApi public static final GraphQLDirective ExperimentalDisableErrorPropagationDirective
    • BUILT_IN_DIRECTIVES

      public static final Set<GraphQLDirective> BUILT_IN_DIRECTIVES
      The set of all built-in directives that are always present in a graphql schema. The iteration order is stable and meaningful.
    • BUILT_IN_DIRECTIVES_MAP

      public static final Map<String,GraphQLDirective> BUILT_IN_DIRECTIVES_MAP
      A map from directive name to directive for all built-in directives.
  • Constructor Details

    • Directives

      public Directives()
  • Method Details

    • isBuiltInDirective

      public static boolean isBuiltInDirective(String directiveName)
      Returns true if a directive with the provided name is a built-in directive.
      Parameters:
      directiveName - the name of the directive in question
      Returns:
      true if the directive is built-in, false otherwise
    • isBuiltInDirective

      public static boolean isBuiltInDirective(GraphQLDirective directive)
      Returns true if the provided directive is a built-in directive.
      Parameters:
      directive - the directive in question
      Returns:
      true if the directive is built-in, false otherwise
    • isExperimentalDisableErrorPropagationDirectiveEnabled

      public static boolean isExperimentalDisableErrorPropagationDirectiveEnabled()
      This can be used to get the state the `@experimental_disableErrorPropagation` directive support on a JVM wide basis .
      Returns:
      true if the `@experimental_disableErrorPropagation` directive will be respected
    • setExperimentalDisableErrorPropagationEnabled

      public static void setExperimentalDisableErrorPropagationEnabled(boolean flag)
      This can be used to disable the `@experimental_disableErrorPropagation` directive support on a JVM wide basis in case your server implementation does NOT want to act on this directive ever.
      Parameters:
      flag - the desired state of the flag