Class NormalizedDocumentFactory.Options

java.lang.Object
graphql.normalized.nf.NormalizedDocumentFactory.Options
Enclosing class:
NormalizedDocumentFactory

public static class NormalizedDocumentFactory.Options extends Object
  • Field Details

    • DEFAULT_MAX_FIELDS_COUNT

      public static final int DEFAULT_MAX_FIELDS_COUNT
      The default max fields count is 100,000. This is big enough for even very large queries, but can be changed via {#setDefaultOptions
      See Also:
  • Method Details

    • setDefaultOptions

      public static void setDefaultOptions(NormalizedDocumentFactory.Options options)
      Sets new default Options used when creating instances of NormalizedDocument.
      Parameters:
      options - new default options
    • defaultOptions

      public static NormalizedDocumentFactory.Options defaultOptions()
      Returns the default options used when creating instances of NormalizedDocument.
      Returns:
      the default options
    • locale

      public NormalizedDocumentFactory.Options locale(Locale locale)
      Locale to use when parsing the query.

      e.g. can be passed to Coercing for parsing.

      Parameters:
      locale - the locale to use
      Returns:
      new options object to use
    • graphQLContext

      public NormalizedDocumentFactory.Options graphQLContext(GraphQLContext graphQLContext)
      Context object to use when parsing the operation.

      Can be used to intercept input values e.g. using InputInterceptor.

      Parameters:
      graphQLContext - the context to use
      Returns:
      new options object to use
    • maxChildrenDepth

      public NormalizedDocumentFactory.Options maxChildrenDepth(int maxChildrenDepth)
      Controls the maximum depth of the operation. Can be used to prevent against malicious operations.
      Parameters:
      maxChildrenDepth - the max depth
      Returns:
      new options object to use
    • maxFieldsCount

      public NormalizedDocumentFactory.Options maxFieldsCount(int maxFieldsCount)
      Controls the maximum number of ENFs created. Can be used to prevent against malicious operations.
      Parameters:
      maxFieldsCount - the max number of ENFs created
      Returns:
      new options object to use
    • deferSupport

      @ExperimentalApi public NormalizedDocumentFactory.Options deferSupport(boolean deferSupport)
      Controls whether defer execution is supported when creating instances of NormalizedDocument.
      Parameters:
      deferSupport - true to enable support for defer
      Returns:
      new options object to use
    • getGraphQLContext

      public GraphQLContext getGraphQLContext()
      Returns:
      context to use during operation parsing
      See Also:
    • getLocale

      public Locale getLocale()
      Returns:
      locale to use during operation parsing
      See Also:
    • getMaxChildrenDepth

      public int getMaxChildrenDepth()
      Returns:
      maximum children depth before aborting parsing
      See Also:
    • getMaxFieldsCount

      public int getMaxFieldsCount()