Skip to main content

ParseOptions

Configuration options to control parser behavior

Index

Properties

optionalallowLegacyFragmentVariables

allowLegacyFragmentVariables?: boolean
@deprecated

will be removed in the v17.0.0

If enabled, the parser will understand and parse variable definitions contained in a fragment definition. They’ll be represented in the variableDefinitions field of the FragmentDefinitionNode.

The syntax is identical to normal, query-defined variables. For example:

fragment A($var: Boolean = false) on T {
...
}

optionalexperimentalClientControlledNullability

experimentalClientControlledNullability?: boolean

EXPERIMENTAL:

If enabled, the parser will understand and parse Client Controlled Nullability Designators contained in Fields. They’ll be represented in the nullabilityAssertion field of the FieldNode.

The syntax looks like the following:

  {
nullableField!
nonNullableField?
nonNullableSelectionSet? {
childField!
}
}

Note: this feature is experimental and may change or be removed in the future.

optionalnoLocation

noLocation?: boolean

By default, the parser creates AST nodes that know the location in the source that they correspond to. This configuration flag disables that behavior for performance or testing.