Package graphql.normalized.nf
Class NormalizedDocumentFactory.Options
- java.lang.Object
-
- graphql.normalized.nf.NormalizedDocumentFactory.Options
-
- Enclosing class:
- NormalizedDocumentFactory
public static class NormalizedDocumentFactory.Options extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_MAX_FIELDS_COUNT
The default max fields count is 100,000.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static NormalizedDocumentFactory.Options
defaultOptions()
Returns the default options used when creating instances ofNormalizedDocument
.NormalizedDocumentFactory.Options
deferSupport(boolean deferSupport)
Controls whether defer execution is supported when creating instances ofNormalizedDocument
.GraphQLContext
getGraphQLContext()
java.util.Locale
getLocale()
int
getMaxChildrenDepth()
int
getMaxFieldsCount()
NormalizedDocumentFactory.Options
graphQLContext(GraphQLContext graphQLContext)
Context object to use when parsing the operation.NormalizedDocumentFactory.Options
locale(java.util.Locale locale)
Locale to use when parsing the query.NormalizedDocumentFactory.Options
maxChildrenDepth(int maxChildrenDepth)
Controls the maximum depth of the operation.NormalizedDocumentFactory.Options
maxFieldsCount(int maxFieldsCount)
Controls the maximum number of ENFs created.static void
setDefaultOptions(NormalizedDocumentFactory.Options options)
Sets new default Options used when creating instances ofNormalizedDocument
.
-
-
-
Field Detail
-
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:
- Constant Field Values
-
-
Method Detail
-
setDefaultOptions
public static void setDefaultOptions(NormalizedDocumentFactory.Options options)
Sets new default Options used when creating instances ofNormalizedDocument
.- Parameters:
options
- new default options
-
defaultOptions
public static NormalizedDocumentFactory.Options defaultOptions()
Returns the default options used when creating instances ofNormalizedDocument
.- Returns:
- the default options
-
locale
public NormalizedDocumentFactory.Options locale(java.util.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 ofNormalizedDocument
.- 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:
graphQLContext(GraphQLContext)
-
getLocale
public java.util.Locale getLocale()
- Returns:
- locale to use during operation parsing
- See Also:
locale(Locale)
-
getMaxChildrenDepth
public int getMaxChildrenDepth()
- Returns:
- maximum children depth before aborting parsing
- See Also:
maxChildrenDepth(int)
-
getMaxFieldsCount
public int getMaxFieldsCount()
-
-