Class SchemaGenerator.Options

java.lang.Object
graphql.schema.idl.SchemaGenerator.Options
Enclosing class:
SchemaGenerator

public static class SchemaGenerator.Options extends Object
These options control how the schema generation works
  • Method Details

    • isUseCommentsAsDescription

      public boolean isUseCommentsAsDescription()
    • isCaptureAstDefinitions

      public boolean isCaptureAstDefinitions()
    • isUseAppliedDirectivesOnly

      public boolean isUseAppliedDirectivesOnly()
    • defaultOptions

      public static SchemaGenerator.Options defaultOptions()
    • useCommentsAsDescriptions

      public SchemaGenerator.Options useCommentsAsDescriptions(boolean useCommentsAsDescription)
      This controls whether # comments can be used as descriptions in the built schema. For specification legacy reasons # comments used to be used as schema element descriptions. The specification has since clarified this and "" quoted string descriptions are the sanctioned way to make scheme element descriptions.
      Parameters:
      useCommentsAsDescription - the flag to control whether comments can be used as schema element descriptions
      Returns:
      a new Options object
    • captureAstDefinitions

      public SchemaGenerator.Options captureAstDefinitions(boolean captureAstDefinitions)
      Memory can be saved if the original AST definitions are not associated with the built runtime types. However some tooling may require them.
      Parameters:
      captureAstDefinitions - the flag on whether to capture AST definitions
      Returns:
      a new Options object
    • useAppliedDirectivesOnly

      public SchemaGenerator.Options useAppliedDirectivesOnly(boolean useAppliedDirectivesOnly)
      The class GraphQLDirective should really represent the definition of a directive, and not its use on schema elements. The new GraphQLAppliedDirective has been created to fix this however for legacy reasons both classes will be put on schema elements. This flag allows you to only use GraphQLAppliedDirective on schema elements.
      Parameters:
      useAppliedDirectivesOnly - the flag on whether to use GraphQLAppliedDirectives only on schema elements
      Returns:
      a new Options object