Type Types.Config
File match codegen.yml codegen.yaml codegen.json .codegen.yml .codegen.yaml .codegen.json
Schema URL https://catalog.lintel.tools/schemas/schemastore/graphql-code-generator/latest.json
Source https://www.graphql-code-generator.com/config.schema.json

Validate with Lintel

npx @lintel/lintel check
Type: Types.Config

Definitions

Types.Config object

Represents the root YAML schema for the config file.

require string[] | string
customFetch Types.CustomSchemaFetcher | string

Specify a Node module name, a custom file, or a function, to be used instead of a standard fetch.

config object

Configuration object containing key => value that will be passed to the plugins. Specifying configuration in this level of your configuration file will pass it to all plugins, in all outputs.

The options may vary depends on what plugins you are using.

For more details: https://graphql-code-generator.com/docs/config-reference/config-field

generates Record<string, Types.ConfiguredPlugin[] | Types.ConfiguredOutput>

A map where the key represents an output path for the generated code and the value represents a set of options which are relevant for that specific file.

For more details: https://graphql-code-generator.com/docs/config-reference/codegen-config

overwrite boolean

A flag to overwrite files if they already exist when generating code (true by default).

For more details: https://graphql-code-generator.com/docs/config-reference/codegen-config

watch string[] | string | boolean

A flag to trigger codegen when there are changes in the specified GraphQL schemas.

You can either specify a boolean to turn it on/off or specify an array of glob patterns to add custom files to the watch.

For more details: https://graphql-code-generator.com/docs/getting-started/development-workflow#watch-mode

ignoreNoDocuments boolean

A flag to suppress non-zero exit code when there are no documents to generate.

emitLegacyCommonJSImports boolean

A flag to disable adding .js extension to the output file. Default: true.

importExtension string[] | string

Append this extension to all imports. Useful for ESM environments that require file extensions in import statements.

silent boolean

A flag to suppress printing errors when they occur.

verbose boolean

A flag to output more detailed information about tasks

debug boolean

A flag to output debug logs

errorsOnly boolean

A flag to print only errors.

pluginLoader __type_10
pluginContext Record<string, any>

Additional context passed to plugins

pluckConfig object

Allows you to override the configuration for @graphql-tools/graphql-tag-pluck, the tool that extracts your GraphQL operations from your code files.

For more details: https://graphql-code-generator.com/docs/config-reference/documents-field#graphql-tag-pluck

4 nested properties
modules object[]
gqlMagicComment string

Configures the magic GraphQL comments to look for. The default is GraphQL.

globalIdentifier string

Overrides the name of the default GraphQL name identifier.

globalGqlIdentifierName string[] | string

Allows to use a global identifier instead of a module import.

hooks __type_4
noSilentErrors boolean

Alows to raise errors if any matched files are not valid GraphQL. Default: false.

allowPartialOutputs boolean

If true, write to files whichever generates block succeeds. If false, one failed generates means no output is written to files. Default: false

FlutterFreezedPluginConfig object

configure the flutter-freezed plugin

camelCasedEnums {(boolean | DartIdentifierCasing)}

Setting this option to true will camelCase enum values as required by Dart's recommended linter.

If set to false, the original casing as specified in the Graphql Schema is used

You can also transform the casing by specifying your preferred casing for Enum values.

Available options are: 'snake_case', 'camelCase' and 'PascalCase'

For consistency, this option applies the same configuration to all Enum Types in the GraphQL Schema Default value: "true"

copyWith {(boolean | TypeNamePattern)}

The freezed library has this option enabled by default. Use this option to enable/disable this option completely.

The plugin by default generates immutable Freezed models using the @freezed decorator.

If this option is configured, the plugin will generate immutable Freezed models using the @Freezed(copyWith: value) instead.

Setting a boolean value will enable/disable this option globally for every GraphQL Type but you can also set this option to true for one or more GraphQL Types using a TypeNamePattern. Default value: "undefined"

customScalars {(Record<string, string>)}

The key is the GraphQL Scalar Type and the value is the equivalent Dart Type

The plugin automatically handles built-in GraphQL Scalar Types so only specify the custom Scalars in your Graphql Schema. Default value: "[object Object]"

defaultValues {([pattern: FieldNamePattern, value: string, appliesOn: AppliesOnParameters[]][])}

This will annotate the generated parameter with a @Default(value: defaultValue) decorator.

The default value will be interpolated into the @Default(value: ${value}) decorator so Use backticks for the value element so that you can use quotation marks for string values. E.g: "I'm a string default value" but Episode.jedi is not a string value.

Use the appliesOn to specify where this option should be applied on Default value: "undefined"

deprecated {([pattern: Pattern, appliesOn: (AppliesOnFactory | AppliesOnParameters)[]][])}

Using a TypeNamePattern, you can mark an entire factory constructor for one or more GraphQL types as deprecated.

Likewise, using a FieldNamePattern, you can mark one or more fields as deprecated

Since the first element in the tuple has a type signature of Pattern, you can use either TypeNamePattern or FieldNamePattern or use both by composing them with Pattern.compose(...)

Use the appliesOn to specify which block this option should be applied on Default value: "undefined"

equal {(boolean | TypeNamePattern)}

The freezed library has this option enabled by default. Use this option to enable/disable this option completely.

The plugin by default generates immutable Freezed models using the @freezed decorator.

If this option is configured, the plugin will generate immutable Freezed models using the @Freezed(equal: value) instead.

Setting a boolean value will enable/disable this option globally for every GraphQL Type but you can also set this option to true for one or more GraphQL Types using a TypeNamePattern. Default value: "undefined"

escapeDartKeywords {(boolean | [pattern: Pattern, prefix?: string, suffix?: string, appliesOn?: AppliesOn[]][])}

Wraps the fields names that are valid Dart keywords with the prefix and suffix given Default value: "true"

final {([pattern: FieldNamePattern, appliesOn: AppliesOnParameters[]][])}

This will mark the specified parameters as final Default value: "undefined"

ignoreTypes {(TypeNamePattern)}

names of GraphQL types to ignore when generating Freezed classes Default value: "undefined"

immutable {(boolean | TypeNamePattern)}

The freezed library by default generates immutable models decorated with the @freezed decorator. This option if set to false the plugin will generate mutable Freezed models using the @unfreezed decorator instead.

Setting a boolean value will enable/disable this option globally for every GraphQL Type but you can also set this option to true for one or more GraphQL Types using a TypeNamePattern. Default value: "undefined"

makeCollectionsUnmodifiable {(boolean | TypeNamePattern)}

allows collections(lists/maps) to be modified even if class is immutable Default value: "undefined"

mergeTypes {(Record<string, TypeName[]>)}

maps over the value(array of typeNames) and transform each as a named factory constructor inside a class generated for the key(target GraphQL Object Type). Default value: "undefined"

mutableInputs TypeNamePattern | boolean

since inputs will be used to collect data, it makes sense to make them mutable with Freezed's @unfreezed decorator.

This overrides(in order words: has a higher precedence than) the immutable config value ONLY for GraphQL input types. Default value: "true"

privateEmptyConstructor TypeNamePattern | boolean

if true, defines a private empty constructor to allow getter and methods to work on the class Default value: "true"

unionClass array[]

customize the key to be used for fromJson with multiple constructors Default value: "undefined"

ReactQueryRawPluginConfig object

This plugin generates React-Query Hooks with TypeScript typings.

It extends the basic TypeScript plugins: @graphql-codegen/typescript, @graphql-codegen/typescript-operations - and thus shares a similar configuration.

If you are using the react-query package instead of the @tanstack/react-query package in your project, please set the legacyMode option to true.

fetcher HardcodedFetch | object | string

Customize the fetcher you wish to use in the generated file. React-Query is agnostic to the data-fetching layer, so you should provide it, or use a custom one.

The following options are available to use:

  • 'fetch' - requires you to specify endpoint and headers on each call, and uses fetch to do the actual http call.
  • { endpoint: string, fetchParams: RequestInit }: hardcode your endpoint and fetch options into the generated output, using the environment fetch method. You can also use process.env.MY_VAR as endpoint or header value.
  • file#identifier - You can use custom fetcher method that should implement the exported ReactQueryFetcher interface. Example: ./my-fetcher#myCustomFetcher.
  • graphql-request: Will generate each hook with client argument, where you should pass your own GraphQLClient (created from graphql-request).
exposeDocument boolean

For each generate query hook adds document field with a corresponding GraphQL query. Useful for queryClient.fetchQuery. Default value: "false"

exposeQueryKeys boolean

For each generate query hook adds getKey(variables: QueryVariables) function. Useful for cache updates. If addInfiniteQuery is true, it will also add a getKey function to each infinite query. Default value: "false"

exposeMutationKeys boolean

For each generate mutation hook adds getKey() function. Useful for call outside of functional component. Default value: "false"

exposeFetcher boolean

For each generate query hook adds fetcher field with a corresponding GraphQL query using the fetcher. It is useful for queryClient.fetchQuery and queryClient.prefetchQuery. Default value: "false"

errorType string

Changes the default "TError" generic type. Default value: "unknown"

addInfiniteQuery boolean

Adds an Infinite Query along side the standard one Default value: "false"

legacyMode boolean

If false, it will work with @tanstack/react-query, default value is true. Default value: "true"

namingConvention NamingConventionFn | NamingConventionMap | string
operationResultSuffix string

Adds a suffix to generated operation result type names Default value: ""

dedupeOperationSuffix boolean

Set this configuration to true if you wish to make sure to remove duplicate operation name suffix. Default value: "false"

omitOperationSuffix boolean

Set this configuration to true if you wish to disable auto add suffix of operation name, like Query, Mutation, Subscription, Fragment. Default value: "false"

documentVariablePrefix string

Changes the GraphQL operations variables prefix. Default value: ""

documentVariableSuffix string

Changes the GraphQL operations variables suffix. Default value: "Document"

fragmentVariablePrefix string

Changes the GraphQL fragments variables prefix. Default value: ""

fragmentVariableSuffix string

Changes the GraphQL fragments variables suffix. Default value: "FragmentDoc"

pureMagicComment boolean

This config adds PURE magic comment to the static variables to enforce treeshaking for your bundler. Default value: "false"

optimizeDocumentNode boolean

If you are using documentNode: documentMode | documentNodeImportFragments, you can set this to true to apply document optimizations for your GraphQL document. This will remove all "loc" and "description" fields from the compiled document, and will remove all empty arrays (such as directives, arguments and variableDefinitions). Default value: "true"

experimentalFragmentVariables boolean

If set to true, it will enable support for parsing variables on fragments. Default value: "false"

scalars object | string

Scalars map or a string, a map between the GraphQL scalar name and the identifier that should be used

typesPrefix string

Prefixes all the generated types. Default value: ""

typesSuffix string

Suffixes all the generated types. Default value: ""

nonOptionalTypename boolean

Automatically adds __typename field to the generated types, even when they are not specified in the selection set, and makes it non-optional Default value: "false"

inlineFragmentTypes string

Whether fragment types should be inlined into other operations. "inline" is the default behavior and will perform deep inlining fragment types within operation type definitions. "combine" is the previous behavior that uses fragment type references without inlining the types (and might cause issues with deeply nested fragment that uses list types). Default value: "inline"

emitLegacyCommonJSImports boolean

Emit legacy common js imports. Default it will be true this way it ensure that generated code works with non-compliant bundlers. Default value: "true"

strictScalars boolean

Makes scalars strict.

If scalars are found in the schema that are not defined in scalars an error will be thrown during codegen. Default value: "false"

defaultScalarType string

Allows you to override the type that unknown scalars will have. Default value: "any"

skipTypename boolean

Does not add __typename to the generated types, unless it was specified in the selection set. Default value: "false"

dedupeFragments boolean

Removes fragment duplicates for reducing data transfer. It is done by removing sub-fragments imports from fragment definition Instead - all of them are imported to the Operation node. Default value: "false"

RTKConfig object
importBaseApiFrom string

Define where to import the base api to inject endpoints into

importBaseApiAlternateName string

Change the import name of the baseApi from default 'api' Default value: "'api'"

exportHooks boolean

Whether to export React Hooks from the generated api. Enable only when using the "@reduxjs/toolkit/query/react" import of createApi Default value: "false"

overrideExisting string

Sets the overrideExisting option, for example to allow for hot module reloading when running graphql-codegen in watch mode. Will directly be injected as code. Default value: "undefined"

addTransformResponse boolean

Sets the addTransformResponse option, which will automatically add a types transformResponse for query Default value: "false"

RawGenericSdkPluginConfig object

This plugin generate a generic SDK (without any Requester implemented), allow you to easily customize the way you fetch your data, without loosing the strongly-typed integration.

usingObservableFrom string

usingObservableFrom: import Observable from 'zen-observable' OR usingObservableFrom: import { Observable } from 'rxjs'

rawRequest boolean

By default the request method return the data or errors key from the response. If you need to access the extensions key you can use the rawRequest method. Default value: "false"

gqlImport string

Customize from which module will gql be imported from. This is useful if you want to use modules other than graphql-tag, e.g. graphql.macro. Default value: "graphql-tag#gql"

documentNodeImport string

Customize from which module will DocumentNode be imported from. This is useful if you want to use modules other than graphql, e.g. @graphql-typed-document-node. Default value: "graphql#DocumentNode"

noExport boolean

Set this configuration to true if you wish to tell codegen to generate code with no export identifier. Default value: "false"

dedupeOperationSuffix boolean

Set this configuration to true if you wish to make sure to remove duplicate operation name suffix. Default value: "false"

omitOperationSuffix boolean

Set this configuration to true if you wish to disable auto add suffix of operation name, like Query, Mutation, Subscription, Fragment. Default value: "false"

operationResultSuffix string

Adds a suffix to generated operation result type names Default value: ""

documentVariablePrefix string

Changes the GraphQL operations variables prefix. Default value: ""

documentVariableSuffix string

Changes the GraphQL operations variables suffix. Default value: "Document"

fragmentVariablePrefix string

Changes the GraphQL fragments variables prefix. Default value: ""

fragmentVariableSuffix string

Changes the GraphQL fragments variables suffix. Default value: "FragmentDoc"

documentMode string
Values: "documentNode" "documentNodeImportFragments" "external" "graphQLTag" "string"
optimizeDocumentNode boolean

If you are using documentMode: documentNode | documentNodeImportFragments, you can set this to true to apply document optimizations for your GraphQL document. This will remove all "loc" and "description" fields from the compiled document, and will remove all empty arrays (such as directives, arguments and variableDefinitions). Default value: "true"

importOperationTypesFrom string

This config is used internally by presets, but you can use it manually to tell codegen to prefix all base types that it's using. This is useful if you wish to generate base types from typescript-operations plugin into a different file, and import it from there. Default value: ""

importDocumentNodeExternallyFrom string

This config should be used if documentMode is external. This has 2 usage:

  • any string: This would be the path to import document nodes from. This can be used if we want to manually create the document nodes e.g. Use graphql-tag in a separate file and export the generated document
  • 'near-operation-file': This is a special mode that is intended to be used with near-operation-file preset to import document nodes from those files. If these files are .graphql files, we make use of webpack loader. Default value: ""
pureMagicComment boolean

This config adds PURE magic comment to the static variables to enforce treeshaking for your bundler. Default value: "false"

experimentalFragmentVariables boolean

If set to true, it will enable support for parsing variables on fragments. Default value: "false"

strictScalars boolean

Makes scalars strict.

If scalars are found in the schema that are not defined in scalars an error will be thrown during codegen. Default value: "false"

defaultScalarType string

Allows you to override the type that unknown scalars will have. Default value: "any"

scalars object | string

Scalars map or a string, a map between the GraphQL scalar name and the identifier that should be used

namingConvention NamingConventionFn_1 | NamingConventionMap_1 | string
typesPrefix string

Prefixes all the generated types. Default value: ""

typesSuffix string

Suffixes all the generated types. Default value: ""

skipTypename boolean

Does not add __typename to the generated types, unless it was specified in the selection set. Default value: "false"

nonOptionalTypename boolean

Automatically adds __typename field to the generated types, even when they are not specified in the selection set, and makes it non-optional Default value: "false"

useTypeImports boolean

Will use import type {} rather than import {} when importing only types. This gives compatibility with TypeScript's "importsNotUsedAsValues": "error" option Default value: "false"

inlineFragmentTypes string

Whether fragment types should be inlined into other operations. "inline" is the default behavior and will perform deep inlining fragment types within operation type definitions. "combine" is the previous behavior that uses fragment type references without inlining the types (and might cause issues with deeply nested fragment that uses list types). "mask" transforms the types for use with fragment masking. Useful when masked types are needed when not using the "client" preset e.g. such as combining it with Apollo Client's data masking feature. Default value: "inline"

emitLegacyCommonJSImports boolean

Emit legacy common js imports. Default it will be true this way it ensure that generated code works with non-compliant bundlers. Default value: "true"

importExtension string[] | string

Append this extension to all imports. Useful for ESM environments that require file extensions in import statements.

extractAllFieldsToTypes boolean

Extract all field types to their own types, instead of inlining them. This helps to reduce type duplication, and makes type errors more readable. It can also significantly reduce the size of the generated code, the generation time, and the typechecking time. Default value: "false"

printFieldsOnNewLines boolean

If you prefer to have each field in generated types printed on a new line, set this to true. This can be useful for improving readability of the resulting types, without resorting to running tools like Prettier on the output. Default value: "false"

includeExternalFragments boolean

Whether to include external fragments in the generated code. External fragments are not defined in the same location as the operation definition. Default value: "false"

ApolloClientHelpersConfig object
useTypeImports boolean

Will use import type {} rather than import {} when importing only types. This gives compatibility with TypeScript's "importsNotUsedAsValues": "error" option Default value: "false"

requireKeyFields boolean

Remove optional sign from all keyFields fields. Default value: "false"

requirePoliciesForAllTypes boolean

Remove optional sign from all generated keys of the root TypePolicy. Default value: "false"

AddPluginConfig object
placement string

Allow you to choose where to add the content. Default value: "prepend"

Values: "append" "content" "prepend"
content string[] | string

The actual content you wish to add, either a string or array of strings. You can also specify a path to a local file and the content if it will be loaded by codegen.

TimePluginConfig object
format string

Customize the Moment format of the output time. Default value: "YYYY-MM-DDTHH:mm:ssZ"

message string

Customize the comment message Default value: "'Generated on'"

TypeScriptPluginConfig object

This plugin generates the base TypeScript types, based on your GraphQL schema.

The types generated by this plugin are simple, and refers to the exact structure of your schema, and it's used as the base types for other plugins (such as typescript-operations / typescript-resolvers)

avoidOptionals AvoidOptionalsConfig | boolean

This will cause the generator to avoid using TypeScript optionals (?) on types, so the following definition: type A { myField: String } will output myField: Maybe<string> instead of myField?: Maybe<string>. Default value: "false"

constEnums boolean

Will prefix every generated enum with const, you can read more about const enums here: https://www.typescriptlang.org/docs/handbook/enums.html. Default value: "false"

enumsAsTypes boolean

Generates enum as TypeScript string union type instead of an enum. Useful if you wish to generate .d.ts declaration file instead of .ts, or if you want to avoid using TypeScript enums due to bundle size concerns Default value: "false"

numericEnums boolean

Controls whether to preserve typescript enum values as numbers Default value: "false"

futureProofEnums boolean

This option controls whether or not a catch-all entry is added to enum type definitions for values that may be added in the future. This is useful if you are using relay. Default value: "false"

futureProofUnions boolean

This option controls whether or not a catch-all entry is added to union type definitions for values that may be added in the future. This is useful if you are using relay. Default value: "false"

enumsAsConst boolean

Generates enum as TypeScript const assertions instead of enum. This can even be used to enable enum-like patterns in plain JavaScript code if you choose not to use TypeScript’s enum construct. Default value: "false"

onlyEnums boolean

This will cause the generator to emit types for enums only. Default value: "false"

onlyOperationTypes boolean

This will cause the generator to emit types for operations only (basically only enums and scalars). Interacts well with preResolveTypes: true Default value: "false"

immutableTypes boolean

Generates immutable types by adding readonly to properties and uses ReadonlyArray. Default value: "false"

maybeValue string

Allow to override the type value of Maybe. Default value: "T | null"

inputMaybeValue string

Allow to override the type value of Maybe for input types and arguments. This is useful in case you want to differentiate between the wrapper of input and output types. By default, this type just refers to Maybe type, but you can override its definition. Default value: "Maybe"

noExport boolean

Set to true in order to generate output without export modifier. This is useful if you are generating .d.ts file and want it to be globally available. Default value: "false"

disableDescriptions boolean

Set the value to true in order to disable all description generation. Default value: "false"

useImplementingTypes boolean

When a GraphQL interface is used for a field, this flag will use the implementing types, instead of the interface itself. Default value: "false"

wrapEntireFieldDefinitions boolean

Set to true in order to wrap field definitions with EntireFieldWrapper. This is useful to allow return types such as Promises and functions for fields. Differs from wrapFieldDefinitions in that this wraps the entire field definition if i.e. the field is an Array, while wrapFieldDefinitions will wrap every single value inside the array. Default value: "false"

entireFieldWrapperValue string

Allow to override the type value of EntireFieldWrapper. This wrapper applies outside of Array and Maybe unlike fieldWrapperValue, that will wrap the inner type. Default value: "T | Promise | (() => T | Promise)"

allowEnumStringTypes boolean

Allow using enum string values directly.

addUnderscoreToArgsType boolean

Adds _ to generated Args types in order to avoid duplicate identifiers.

enumValues object | string

A raw configuration for enumValues map - can be represented with a single string value for a file path, a map between enum name and a file path, or a map between enum name and an object with explicit enum values.

declarationKind DeclarationKindConfig | string

Overrides the default output for various GraphQL elements.

enumPrefix boolean

Allow you to disable prefixing for generated enums, works in combination with typesPrefix. Default value: "true"

enumSuffix boolean

Allow you to disable suffixing for generated enums, works in combination with typesSuffix. Default value: "true"

fieldWrapperValue string

Allow you to add wrapper for field type, use T as the generic value. Make sure to set wrapFieldDefinitions to true in order to make this flag work. Default value: "T"

wrapFieldDefinitions boolean

Set to true in order to wrap field definitions with FieldWrapper. This is useful to allow return types such as Promises and functions. Default value: "false"

ignoreEnumValuesFromSchema boolean

This will cause the generator to ignore enum values defined in GraphQLSchema Default value: "false"

directiveArgumentAndInputFieldMappings __type_15
directiveArgumentAndInputFieldMappingTypeSuffix string

Adds a suffix to the imported names to prevent name clashes.

strictScalars boolean

Makes scalars strict.

If scalars are found in the schema that are not defined in scalars an error will be thrown during codegen. Default value: "false"

defaultScalarType string

Allows you to override the type that unknown scalars will have. Default value: "any"

scalars object | string

Scalars map or a string, a map between the GraphQL scalar name and the identifier that should be used

namingConvention NamingConventionFn_1 | NamingConventionMap_1 | string
typesPrefix string

Prefixes all the generated types. Default value: ""

typesSuffix string

Suffixes all the generated types. Default value: ""

skipTypename boolean

Does not add __typename to the generated types, unless it was specified in the selection set. Default value: "false"

nonOptionalTypename boolean

Automatically adds __typename field to the generated types, even when they are not specified in the selection set, and makes it non-optional Default value: "false"

useTypeImports boolean

Will use import type {} rather than import {} when importing only types. This gives compatibility with TypeScript's "importsNotUsedAsValues": "error" option Default value: "false"

inlineFragmentTypes string

Whether fragment types should be inlined into other operations. "inline" is the default behavior and will perform deep inlining fragment types within operation type definitions. "combine" is the previous behavior that uses fragment type references without inlining the types (and might cause issues with deeply nested fragment that uses list types). "mask" transforms the types for use with fragment masking. Useful when masked types are needed when not using the "client" preset e.g. such as combining it with Apollo Client's data masking feature. Default value: "inline"

emitLegacyCommonJSImports boolean

Emit legacy common js imports. Default it will be true this way it ensure that generated code works with non-compliant bundlers. Default value: "true"

importExtension string[] | string

Append this extension to all imports. Useful for ESM environments that require file extensions in import statements.

extractAllFieldsToTypes boolean

Extract all field types to their own types, instead of inlining them. This helps to reduce type duplication, and makes type errors more readable. It can also significantly reduce the size of the generated code, the generation time, and the typechecking time. Default value: "false"

printFieldsOnNewLines boolean

If you prefer to have each field in generated types printed on a new line, set this to true. This can be useful for improving readability of the resulting types, without resorting to running tools like Prettier on the output. Default value: "false"

includeExternalFragments boolean

Whether to include external fragments in the generated code. External fragments are not defined in the same location as the operation definition. Default value: "false"

TypeScriptDocumentsPluginConfig object

This plugin generates TypeScript types based on your GraphQLSchema and your GraphQL operations and fragments. It generates types for your GraphQL documents: Query, Mutation, Subscription and Fragment.

Note: In most configurations, this plugin requires you to use `typescript as well, because it depends on its base types.

arrayInputCoercion boolean

The GraphQL spec allows arrays and a single primitive value for list input. This allows to deactivate that behavior to only accept arrays instead of single values. If set to false, the definition: query foo(bar: [Int!]!): Foo will output bar: Array<Int> instead of bar: Array<Int> | Int for the variable part. Default value: "true"

avoidOptionals AvoidOptionalsConfig | boolean

This will cause the generator to avoid using TypeScript optionals (?) on types, so the following definition: type A { myField: String } will output myField: Maybe<string> instead of myField?: Maybe<string>. Default value: "false"

immutableTypes boolean

Generates immutable types by adding readonly to properties and uses ReadonlyArray. Default value: "false"

flattenGeneratedTypes boolean

Flatten fragment spread and inline fragments into a simple selection set before generating. Default value: "false"

flattenGeneratedTypesIncludeFragments boolean

Include all fragments types when flattenGeneratedTypes is enabled. Default value: "false"

noExport boolean

Set to true in order to generate output without export modifier. This is useful if you are generating .d.ts file and want it to be globally available. Default value: "false"

globalNamespace boolean
addOperationExport boolean

Add const export of the operation name to output file. Pay attention that the file should be d.ts. You can combine it with near-operation-file preset and therefore the types will be generated along with graphql file. Then you need to set extension in presetConfig to be .gql.d.ts and by that you can import gql file in ts files. It will allow you to get everything with one import:

import { GetClient, GetClientQuery, GetClientQueryVariables } from './GetClient.gql.js'

Default value: "false"

maybeValue string

Allow to override the type value of Maybe. Default value: "T | null"

allowUndefinedQueryVariables boolean

Adds undefined as a possible type for query variables Default value: "false"

nullability object

Options related to handling nullability

1 nested properties
errorHandlingClient boolean
preResolveTypes boolean

Uses primitive types where possible. Set to false in order to use Pick and take use the types generated by typescript plugin. Default value: "true"

skipTypeNameForRoot boolean

Avoid adding __typename for root types. This is ignored when a selection explicitly specifies __typename. Default value: "false"

operationResultSuffix string

Adds a suffix to generated operation result type names Default value: ""

dedupeOperationSuffix boolean

Set this configuration to true if you wish to make sure to remove duplicate operation name suffix. Default value: "false"

omitOperationSuffix boolean

Set this configuration to true if you wish to disable auto add suffix of operation name, like Query, Mutation, Subscription, Fragment. Default value: "false"

exportFragmentSpreadSubTypes boolean

If set to true, it will export the sub-types created in order to make it easier to access fields declared under fragment spread. Default value: "false"

experimentalFragmentVariables boolean

If set to true, it will enable support for parsing variables on fragments. Default value: "false"

mergeFragmentTypes boolean

If set to true, merge equal fragment interfaces. Default value: "false"

customDirectives object
1 nested properties
apolloUnmask boolean

Adds integration with Apollo Client's @unmask directive when using Apollo Client's data masking feature. @unmask ensures fields marked by @unmask are available in the type definition. Default value: "false"

addUnderscoreToArgsType boolean

Adds _ to generated Args types in order to avoid duplicate identifiers.

enumValues object | string

A raw configuration for enumValues map - can be represented with a single string value for a file path, a map between enum name and a file path, or a map between enum name and an object with explicit enum values.

declarationKind DeclarationKindConfig | string

Overrides the default output for various GraphQL elements.

enumPrefix boolean

Allow you to disable prefixing for generated enums, works in combination with typesPrefix. Default value: "true"

enumSuffix boolean

Allow you to disable suffixing for generated enums, works in combination with typesSuffix. Default value: "true"

fieldWrapperValue string

Allow you to add wrapper for field type, use T as the generic value. Make sure to set wrapFieldDefinitions to true in order to make this flag work. Default value: "T"

wrapFieldDefinitions boolean

Set to true in order to wrap field definitions with FieldWrapper. This is useful to allow return types such as Promises and functions. Default value: "false"

onlyEnums boolean

This will cause the generator to emit types for enums only Default value: "false"

onlyOperationTypes boolean

This will cause the generator to emit types for operations only (basically only enums and scalars) Default value: "false"

ignoreEnumValuesFromSchema boolean

This will cause the generator to ignore enum values defined in GraphQLSchema Default value: "false"

wrapEntireFieldDefinitions boolean

Set to true in order to wrap field definitions with EntireFieldWrapper. This is useful to allow return types such as Promises and functions for fields. Differs from wrapFieldDefinitions in that this wraps the entire field definition if i.e. the field is an Array, while wrapFieldDefinitions will wrap every single value inside the array. Default value: "true"

entireFieldWrapperValue string

Allow to override the type value of EntireFieldWrapper. This wrapper applies outside of Array and Maybe unlike fieldWrapperValue, that will wrap the inner type. Default value: "T | Promise | (() => T | Promise)"

directiveArgumentAndInputFieldMappings __type_15
directiveArgumentAndInputFieldMappingTypeSuffix string

Adds a suffix to the imported names to prevent name clashes.

strictScalars boolean

Makes scalars strict.

If scalars are found in the schema that are not defined in scalars an error will be thrown during codegen. Default value: "false"

defaultScalarType string

Allows you to override the type that unknown scalars will have. Default value: "any"

scalars object | string

Scalars map or a string, a map between the GraphQL scalar name and the identifier that should be used

namingConvention NamingConventionFn_1 | NamingConventionMap_1 | string
typesPrefix string

Prefixes all the generated types. Default value: ""

typesSuffix string

Suffixes all the generated types. Default value: ""

skipTypename boolean

Does not add __typename to the generated types, unless it was specified in the selection set. Default value: "false"

nonOptionalTypename boolean

Automatically adds __typename field to the generated types, even when they are not specified in the selection set, and makes it non-optional Default value: "false"

useTypeImports boolean

Will use import type {} rather than import {} when importing only types. This gives compatibility with TypeScript's "importsNotUsedAsValues": "error" option Default value: "false"

inlineFragmentTypes string

Whether fragment types should be inlined into other operations. "inline" is the default behavior and will perform deep inlining fragment types within operation type definitions. "combine" is the previous behavior that uses fragment type references without inlining the types (and might cause issues with deeply nested fragment that uses list types). "mask" transforms the types for use with fragment masking. Useful when masked types are needed when not using the "client" preset e.g. such as combining it with Apollo Client's data masking feature. Default value: "inline"

emitLegacyCommonJSImports boolean

Emit legacy common js imports. Default it will be true this way it ensure that generated code works with non-compliant bundlers. Default value: "true"

importExtension string[] | string

Append this extension to all imports. Useful for ESM environments that require file extensions in import statements.

extractAllFieldsToTypes boolean

Extract all field types to their own types, instead of inlining them. This helps to reduce type duplication, and makes type errors more readable. It can also significantly reduce the size of the generated code, the generation time, and the typechecking time. Default value: "false"

printFieldsOnNewLines boolean

If you prefer to have each field in generated types printed on a new line, set this to true. This can be useful for improving readability of the resulting types, without resorting to running tools like Prettier on the output. Default value: "false"

includeExternalFragments boolean

Whether to include external fragments in the generated code. External fragments are not defined in the same location as the operation definition. Default value: "false"

CSharpResolversPluginRawConfig object

This plugin generates C# class identifier for your schema types.

enumValues object | string

A raw configuration for enumValues map - can be represented with a single string value for a file path, a map between enum name and a file path, or a map between enum name and an object with explicit enum values.

namespaceName string

Allow you to customize the namespace name. Default value: "GraphQLCodeGen"

className string

Allow you to customize the parent class name. Default value: "Types"

listType string

Allow you to customize the list type Default value: "IEnumerable"

emitRecords boolean

Emit C# 9.0+ records instead of classes Default value: "false"

emitJsonAttributes boolean

Should JSON attributes be emitted for produced types and properties ot not Default value: "true"

jsonAttributesSource string
Values: "Newtonsoft.Json" "System.Text.Json"
strictScalars boolean

Makes scalars strict.

If scalars are found in the schema that are not defined in scalars an error will be thrown during codegen. Default value: "false"

defaultScalarType string

Allows you to override the type that unknown scalars will have. Default value: "any"

scalars object | string

Scalars map or a string, a map between the GraphQL scalar name and the identifier that should be used

namingConvention NamingConventionFn_1 | NamingConventionMap_1 | string
typesPrefix string

Prefixes all the generated types. Default value: ""

typesSuffix string

Suffixes all the generated types. Default value: ""

skipTypename boolean

Does not add __typename to the generated types, unless it was specified in the selection set. Default value: "false"

nonOptionalTypename boolean

Automatically adds __typename field to the generated types, even when they are not specified in the selection set, and makes it non-optional Default value: "false"

useTypeImports boolean

Will use import type {} rather than import {} when importing only types. This gives compatibility with TypeScript's "importsNotUsedAsValues": "error" option Default value: "false"

inlineFragmentTypes string

Whether fragment types should be inlined into other operations. "inline" is the default behavior and will perform deep inlining fragment types within operation type definitions. "combine" is the previous behavior that uses fragment type references without inlining the types (and might cause issues with deeply nested fragment that uses list types). "mask" transforms the types for use with fragment masking. Useful when masked types are needed when not using the "client" preset e.g. such as combining it with Apollo Client's data masking feature. Default value: "inline"

emitLegacyCommonJSImports boolean

Emit legacy common js imports. Default it will be true this way it ensure that generated code works with non-compliant bundlers. Default value: "true"

importExtension string[] | string

Append this extension to all imports. Useful for ESM environments that require file extensions in import statements.

extractAllFieldsToTypes boolean

Extract all field types to their own types, instead of inlining them. This helps to reduce type duplication, and makes type errors more readable. It can also significantly reduce the size of the generated code, the generation time, and the typechecking time. Default value: "false"

printFieldsOnNewLines boolean

If you prefer to have each field in generated types printed on a new line, set this to true. This can be useful for improving readability of the resulting types, without resorting to running tools like Prettier on the output. Default value: "false"

includeExternalFragments boolean

Whether to include external fragments in the generated code. External fragments are not defined in the same location as the operation definition. Default value: "false"

memberNameConvention string
Values: "camelCase" "pascalCase"
CSharpOperationsRawPluginConfig object

This plugin generates C# class based on your GraphQL operations.

namespaceName string

Allow you to customize the namespace name. Default value: "GraphQLCodeGen"

namedClient string

Defined the global value of namedClient.

querySuffix string

Allows to define a custom suffix for query operations. Default value: "GQL"

mutationSuffix string

Allows to define a custom suffix for mutation operations. Default value: "GQL"

subscriptionSuffix string

Allows to define a custom suffix for Subscription operations. Default value: "GQL"

typesafeOperation boolean

Allows to generate operation methods with class definitions for request/response parameters Default value: "false"

jsonAttributesSource string
Values: "Newtonsoft.Json" "System.Text.Json"
gqlImport string

Customize from which module will gql be imported from. This is useful if you want to use modules other than graphql-tag, e.g. graphql.macro. Default value: "graphql-tag#gql"

documentNodeImport string

Customize from which module will DocumentNode be imported from. This is useful if you want to use modules other than graphql, e.g. @graphql-typed-document-node. Default value: "graphql#DocumentNode"

noExport boolean

Set this configuration to true if you wish to tell codegen to generate code with no export identifier. Default value: "false"

dedupeOperationSuffix boolean

Set this configuration to true if you wish to make sure to remove duplicate operation name suffix. Default value: "false"

omitOperationSuffix boolean

Set this configuration to true if you wish to disable auto add suffix of operation name, like Query, Mutation, Subscription, Fragment. Default value: "false"

operationResultSuffix string

Adds a suffix to generated operation result type names Default value: ""

documentVariablePrefix string

Changes the GraphQL operations variables prefix. Default value: ""

documentVariableSuffix string

Changes the GraphQL operations variables suffix. Default value: "Document"

fragmentVariablePrefix string

Changes the GraphQL fragments variables prefix. Default value: ""

fragmentVariableSuffix string

Changes the GraphQL fragments variables suffix. Default value: "FragmentDoc"

documentMode string
Values: "documentNode" "documentNodeImportFragments" "external" "graphQLTag" "string"
optimizeDocumentNode boolean

If you are using documentMode: documentNode | documentNodeImportFragments, you can set this to true to apply document optimizations for your GraphQL document. This will remove all "loc" and "description" fields from the compiled document, and will remove all empty arrays (such as directives, arguments and variableDefinitions). Default value: "true"

importOperationTypesFrom string

This config is used internally by presets, but you can use it manually to tell codegen to prefix all base types that it's using. This is useful if you wish to generate base types from typescript-operations plugin into a different file, and import it from there. Default value: ""

importDocumentNodeExternallyFrom string

This config should be used if documentMode is external. This has 2 usage:

  • any string: This would be the path to import document nodes from. This can be used if we want to manually create the document nodes e.g. Use graphql-tag in a separate file and export the generated document
  • 'near-operation-file': This is a special mode that is intended to be used with near-operation-file preset to import document nodes from those files. If these files are .graphql files, we make use of webpack loader. Default value: ""
pureMagicComment boolean

This config adds PURE magic comment to the static variables to enforce treeshaking for your bundler. Default value: "false"

experimentalFragmentVariables boolean

If set to true, it will enable support for parsing variables on fragments. Default value: "false"

strictScalars boolean

Makes scalars strict.

If scalars are found in the schema that are not defined in scalars an error will be thrown during codegen. Default value: "false"

defaultScalarType string

Allows you to override the type that unknown scalars will have. Default value: "any"

scalars object | string

Scalars map or a string, a map between the GraphQL scalar name and the identifier that should be used

namingConvention NamingConventionFn_1 | NamingConventionMap_1 | string
typesPrefix string

Prefixes all the generated types. Default value: ""

typesSuffix string

Suffixes all the generated types. Default value: ""

skipTypename boolean

Does not add __typename to the generated types, unless it was specified in the selection set. Default value: "false"

nonOptionalTypename boolean

Automatically adds __typename field to the generated types, even when they are not specified in the selection set, and makes it non-optional Default value: "false"

useTypeImports boolean

Will use import type {} rather than import {} when importing only types. This gives compatibility with TypeScript's "importsNotUsedAsValues": "error" option Default value: "false"

inlineFragmentTypes string

Whether fragment types should be inlined into other operations. "inline" is the default behavior and will perform deep inlining fragment types within operation type definitions. "combine" is the previous behavior that uses fragment type references without inlining the types (and might cause issues with deeply nested fragment that uses list types). "mask" transforms the types for use with fragment masking. Useful when masked types are needed when not using the "client" preset e.g. such as combining it with Apollo Client's data masking feature. Default value: "inline"

emitLegacyCommonJSImports boolean

Emit legacy common js imports. Default it will be true this way it ensure that generated code works with non-compliant bundlers. Default value: "true"

importExtension string[] | string

Append this extension to all imports. Useful for ESM environments that require file extensions in import statements.

extractAllFieldsToTypes boolean

Extract all field types to their own types, instead of inlining them. This helps to reduce type duplication, and makes type errors more readable. It can also significantly reduce the size of the generated code, the generation time, and the typechecking time. Default value: "false"

printFieldsOnNewLines boolean

If you prefer to have each field in generated types printed on a new line, set this to true. This can be useful for improving readability of the resulting types, without resorting to running tools like Prettier on the output. Default value: "false"

includeExternalFragments boolean

Whether to include external fragments in the generated code. External fragments are not defined in the same location as the operation definition. Default value: "false"

memberNameConvention string
Values: "camelCase" "pascalCase"
SchemaASTConfig object

This plugin prints the merged schema as string. If multiple schemas are provided, they will be merged and printed as one schema.

includeDirectives boolean

Include directives to Schema output. Default value: "false"

includeIntrospectionTypes boolean

Include introspection types to Schema output. Default value: "false"

commentDescriptions boolean

Set to true in order to print description as comments (using # instead of """) Default value: "false"

sort boolean

Set to false to disable sorting Default value: "true"

federation boolean
TypeGraphQLPluginConfig object
decoratorName __type_16
decorateTypes string[]

Specifies the objects that will have TypeGraphQL decorators prepended to them, by name. Non-matching types will still be output, but without decorators. If not set, all types will be decorated.

avoidOptionals AvoidOptionalsConfig_1 | boolean

This will cause the generator to avoid using TypeScript optionals (?) on types, so the following definition: type A { myField: String } will output myField: Maybe<string> instead of myField?: Maybe<string>. Default value: "false"

constEnums boolean

Will prefix every generated enum with const, you can read more about const enums here: https://www.typescriptlang.org/docs/handbook/enums.html. Default value: "false"

enumsAsTypes boolean

Generates enum as TypeScript string union type instead of an enum. Useful if you wish to generate .d.ts declaration file instead of .ts, or if you want to avoid using TypeScript enums due to bundle size concerns Default value: "false"

numericEnums boolean

Controls whether to preserve typescript enum values as numbers Default value: "false"

futureProofEnums boolean

This option controls whether or not a catch-all entry is added to enum type definitions for values that may be added in the future. This is useful if you are using relay. Default value: "false"

futureProofUnions boolean

This option controls whether or not a catch-all entry is added to union type definitions for values that may be added in the future. This is useful if you are using relay. Default value: "false"

enumsAsConst boolean

Generates enum as TypeScript const assertions instead of enum. This can even be used to enable enum-like patterns in plain JavaScript code if you choose not to use TypeScript’s enum construct. Default value: "false"

onlyEnums boolean

This will cause the generator to emit types for enums only. Default value: "false"

onlyOperationTypes boolean

This will cause the generator to emit types for operations only (basically only enums and scalars). Interacts well with preResolveTypes: true Default value: "false"

immutableTypes boolean

Generates immutable types by adding readonly to properties and uses ReadonlyArray. Default value: "false"

maybeValue string

Allow to override the type value of Maybe. Default value: "T | null"

inputMaybeValue string

Allow to override the type value of Maybe for input types and arguments. This is useful in case you want to differentiate between the wrapper of input and output types. By default, this type just refers to Maybe type, but you can override its definition. Default value: "Maybe"

noExport boolean

Set to true in order to generate output without export modifier. This is useful if you are generating .d.ts file and want it to be globally available. Default value: "false"

disableDescriptions boolean

Set the value to true in order to disable all description generation. Default value: "false"

useImplementingTypes boolean

When a GraphQL interface is used for a field, this flag will use the implementing types, instead of the interface itself. Default value: "false"

wrapEntireFieldDefinitions boolean

Set to true in order to wrap field definitions with EntireFieldWrapper. This is useful to allow return types such as Promises and functions for fields. Differs from wrapFieldDefinitions in that this wraps the entire field definition if i.e. the field is an Array, while wrapFieldDefinitions will wrap every single value inside the array. Default value: "false"

entireFieldWrapperValue string

Allow to override the type value of EntireFieldWrapper. This wrapper applies outside of Array and Maybe unlike fieldWrapperValue, that will wrap the inner type. Default value: "T | Promise | (() => T | Promise)"

allowEnumStringTypes boolean

Allow using enum string values directly.

addUnderscoreToArgsType boolean

Adds _ to generated Args types in order to avoid duplicate identifiers.

enumValues object | string

A raw configuration for enumValues map - can be represented with a single string value for a file path, a map between enum name and a file path, or a map between enum name and an object with explicit enum values.

declarationKind DeclarationKindConfig_1 | string

Overrides the default output for various GraphQL elements.

enumPrefix boolean

Allow you to disable prefixing for generated enums, works in combination with typesPrefix. Default value: "true"

fieldWrapperValue string

Allow you to add wrapper for field type, use T as the generic value. Make sure to set wrapFieldDefinitions to true in order to make this flag work. Default value: "T"

wrapFieldDefinitions boolean

Set to true in order to wrap field definitions with FieldWrapper. This is useful to allow return types such as Promises and functions. Default value: "false"

ignoreEnumValuesFromSchema boolean

This will cause the generator to ignore enum values defined in GraphQLSchema Default value: "false"

directiveArgumentAndInputFieldMappings __type_17
directiveArgumentAndInputFieldMappingTypeSuffix string

Adds a suffix to the imported names to prevent name clashes.

strictScalars boolean

Makes scalars strict.

If scalars are found in the schema that are not defined in scalars an error will be thrown during codegen. Default value: "false"

defaultScalarType string

Allows you to override the type that unknown scalars will have. Default value: "any"

scalars object | string

Scalars map or a string, a map between the GraphQL scalar name and the identifier that should be used

namingConvention NamingConventionFn_2 | NamingConventionMap_2 | string
typesPrefix string

Prefixes all the generated types. Default value: ""

typesSuffix string

Suffixes all the generated types. Default value: ""

skipTypename boolean

Does not add __typename to the generated types, unless it was specified in the selection set. Default value: "false"

nonOptionalTypename boolean

Automatically adds __typename field to the generated types, even when they are not specified in the selection set, and makes it non-optional Default value: "false"

useTypeImports boolean

Will use import type {} rather than import {} when importing only types. This gives compatibility with TypeScript's "importsNotUsedAsValues": "error" option Default value: "false"

dedupeFragments boolean

Removes fragment duplicates for reducing data transfer. It is done by removing sub-fragments imports from fragment definition Instead - all of them are imported to the Operation node. Default value: "false"

inlineFragmentTypes string

Whether fragment types should be inlined into other operations. "inline" is the default behavior and will perform deep inlining fragment types within operation type definitions. "combine" is the previous behavior that uses fragment type references without inlining the types (and might cause issues with deeply nested fragment that uses list types). Default value: "inline"

emitLegacyCommonJSImports boolean

Emit legacy common js imports. Default it will be true this way it ensure that generated code works with non-compliant bundlers. Default value: "true"

TypeScriptFilesModulesPluginConfig object

This plugin generates TypeScript typings for .graphql files containing GraphQL documents, which later on can be consumed using graphql-tag/loader or use string types if you will use the operations as raw strings, and get type-check and type-safety for your imports. This means that any time you import objects from .graphql files, your IDE will provide auto-complete.

This plugin also handles .graphql files containing multiple GraphQL documents, and name the imports according to the operation name.

âš  Fragments are not generated with named imports, only as default imports, due to graphql-tag/loader behavior.

modulePathPrefix string

Allows specifying a module definition path prefix to provide distinction between generated types. Default value: ""

relativeToCwd boolean

By default, only the filename is being used to generate TS module declarations. Setting this to true will generate it with a full path based on the CWD. Default value: "false"

prefix string

By default, a wildcard is being added as prefix, you can change that to a custom prefix Default value: "*/"

type string

By default, the named exports will have a type DocumentNode. Change this to "string" if you only use raw strings. Default value: "DocumentNode"

Values: "DocumentNode" "string"
NamedOperationsObjectPluginConfig object
identifierName string

Allow you to customize the name of the exported identifier Default value: "namedOperations"

useConsts boolean

Will generate a const string instead of regular string. Default value: "false"

throwOnDuplicate boolean

Throws an error if a duplicate operation name is found. Default value: "false"

RawGraphQLRequestPluginConfig object

This plugin generates graphql-request ready-to-use SDK, which is fully-typed.

rawRequest boolean

By default, the request method return the data or errors key from the response. If you need to access the extensions key you can use the rawRequest method. Default value: "false"

extensionsType string

Allows you to override the type for extensions when rawRequest is enabled. Default value: "any"

gqlImport string

Customize from which module will gql be imported from. This is useful if you want to use modules other than graphql-tag, e.g. graphql.macro. Default value: "graphql-tag#gql"

documentNodeImport string

Customize from which module will DocumentNode be imported from. This is useful if you want to use modules other than graphql, e.g. @graphql-typed-document-node. Default value: "graphql#DocumentNode"

noExport boolean

Set this configuration to true if you wish to tell codegen to generate code with no export identifier. Default value: "false"

dedupeOperationSuffix boolean

Set this configuration to true if you wish to make sure to remove duplicate operation name suffix. Default value: "false"

omitOperationSuffix boolean

Set this configuration to true if you wish to disable auto add suffix of operation name, like Query, Mutation, Subscription, Fragment. Default value: "false"

operationResultSuffix string

Adds a suffix to generated operation result type names Default value: ""

documentVariablePrefix string

Changes the GraphQL operations variables prefix. Default value: ""

documentVariableSuffix string

Changes the GraphQL operations variables suffix. Default value: "Document"

fragmentVariablePrefix string

Changes the GraphQL fragments variables prefix. Default value: ""

fragmentVariableSuffix string

Changes the GraphQL fragments variables suffix. Default value: "FragmentDoc"

documentMode string
Values: "documentNode" "documentNodeImportFragments" "external" "graphQLTag" "string"
optimizeDocumentNode boolean

If you are using documentMode: documentNode | documentNodeImportFragments, you can set this to true to apply document optimizations for your GraphQL document. This will remove all "loc" and "description" fields from the compiled document, and will remove all empty arrays (such as directives, arguments and variableDefinitions). Default value: "true"

importOperationTypesFrom string

This config is used internally by presets, but you can use it manually to tell codegen to prefix all base types that it's using. This is useful if you wish to generate base types from typescript-operations plugin into a different file, and import it from there. Default value: ""

importDocumentNodeExternallyFrom string

This config should be used if documentMode is external. This has 2 usage:

  • any string: This would be the path to import document nodes from. This can be used if we want to manually create the document nodes e.g. Use graphql-tag in a separate file and export the generated document
  • 'near-operation-file': This is a special mode that is intended to be used with near-operation-file preset to import document nodes from those files. If these files are .graphql files, we make use of webpack loader. Default value: ""
pureMagicComment boolean

This config adds PURE magic comment to the static variables to enforce treeshaking for your bundler. Default value: "false"

experimentalFragmentVariables boolean

If set to true, it will enable support for parsing variables on fragments. Default value: "false"

strictScalars boolean

Makes scalars strict.

If scalars are found in the schema that are not defined in scalars an error will be thrown during codegen. Default value: "false"

defaultScalarType string

Allows you to override the type that unknown scalars will have. Default value: "any"

scalars object | string

Scalars map or a string, a map between the GraphQL scalar name and the identifier that should be used

namingConvention NamingConventionFn_1 | NamingConventionMap_1 | string
typesPrefix string

Prefixes all the generated types. Default value: ""

typesSuffix string

Suffixes all the generated types. Default value: ""

skipTypename boolean

Does not add __typename to the generated types, unless it was specified in the selection set. Default value: "false"

nonOptionalTypename boolean

Automatically adds __typename field to the generated types, even when they are not specified in the selection set, and makes it non-optional Default value: "false"

useTypeImports boolean

Will use import type {} rather than import {} when importing only types. This gives compatibility with TypeScript's "importsNotUsedAsValues": "error" option Default value: "false"

inlineFragmentTypes string

Whether fragment types should be inlined into other operations. "inline" is the default behavior and will perform deep inlining fragment types within operation type definitions. "combine" is the previous behavior that uses fragment type references without inlining the types (and might cause issues with deeply nested fragment that uses list types). "mask" transforms the types for use with fragment masking. Useful when masked types are needed when not using the "client" preset e.g. such as combining it with Apollo Client's data masking feature. Default value: "inline"

emitLegacyCommonJSImports boolean

Emit legacy common js imports. Default it will be true this way it ensure that generated code works with non-compliant bundlers. Default value: "true"

importExtension string[] | string

Append this extension to all imports. Useful for ESM environments that require file extensions in import statements.

extractAllFieldsToTypes boolean

Extract all field types to their own types, instead of inlining them. This helps to reduce type duplication, and makes type errors more readable. It can also significantly reduce the size of the generated code, the generation time, and the typechecking time. Default value: "false"

printFieldsOnNewLines boolean

If you prefer to have each field in generated types printed on a new line, set this to true. This can be useful for improving readability of the resulting types, without resorting to running tools like Prettier on the output. Default value: "false"

includeExternalFragments boolean

Whether to include external fragments in the generated code. External fragments are not defined in the same location as the operation definition. Default value: "false"

TypeScriptMongoPluginConfig object
dbTypeSuffix string

Customize the suffix for the generated GraphQL types. Default value: "DbObject"

dbInterfaceSuffix string

Customize the suffix for the generated GraphQL interfaces. Default value: "DbObject"

objectIdType string

Customize the type of _id fields. You can either specify a type name, or specify module#type. Default value: "mongodb#ObjectId"

idFieldName string

Customize the name of the id field generated after using @id directive over a GraphQL field. Default value: "_id"

enumsAsString boolean

Replaces generated enum values with string. Default value: "true"

avoidOptionals boolean

This will cause the generator to avoid using TypeScript optionals (?), so the following definition: type A { myField: String } will output myField: Maybe<string> instead of myField?: Maybe<string>. Default value: "false"

strictScalars boolean

Makes scalars strict.

If scalars are found in the schema that are not defined in scalars an error will be thrown during codegen. Default value: "false"

defaultScalarType string

Allows you to override the type that unknown scalars will have. Default value: "any"

scalars object | string

Scalars map or a string, a map between the GraphQL scalar name and the identifier that should be used

namingConvention NamingConventionFn_1 | NamingConventionMap_1 | string
typesPrefix string

Prefixes all the generated types. Default value: ""

typesSuffix string

Suffixes all the generated types. Default value: ""

skipTypename boolean

Does not add __typename to the generated types, unless it was specified in the selection set. Default value: "false"

nonOptionalTypename boolean

Automatically adds __typename field to the generated types, even when they are not specified in the selection set, and makes it non-optional Default value: "false"

useTypeImports boolean

Will use import type {} rather than import {} when importing only types. This gives compatibility with TypeScript's "importsNotUsedAsValues": "error" option Default value: "false"

inlineFragmentTypes string

Whether fragment types should be inlined into other operations. "inline" is the default behavior and will perform deep inlining fragment types within operation type definitions. "combine" is the previous behavior that uses fragment type references without inlining the types (and might cause issues with deeply nested fragment that uses list types). "mask" transforms the types for use with fragment masking. Useful when masked types are needed when not using the "client" preset e.g. such as combining it with Apollo Client's data masking feature. Default value: "inline"

emitLegacyCommonJSImports boolean

Emit legacy common js imports. Default it will be true this way it ensure that generated code works with non-compliant bundlers. Default value: "true"

importExtension string[] | string

Append this extension to all imports. Useful for ESM environments that require file extensions in import statements.

extractAllFieldsToTypes boolean

Extract all field types to their own types, instead of inlining them. This helps to reduce type duplication, and makes type errors more readable. It can also significantly reduce the size of the generated code, the generation time, and the typechecking time. Default value: "false"

printFieldsOnNewLines boolean

If you prefer to have each field in generated types printed on a new line, set this to true. This can be useful for improving readability of the resulting types, without resorting to running tools like Prettier on the output. Default value: "false"

includeExternalFragments boolean

Whether to include external fragments in the generated code. External fragments are not defined in the same location as the operation definition. Default value: "false"

TypeScriptResolversPluginConfig object

This plugin generates TypeScript signature for resolve functions of your GraphQL API. You can use this plugin to generate simple resolvers signature based on your GraphQL types, or you can change its behavior be providing custom model types (mappers).

You can find a blog post explaining the usage of this plugin here: https://the-guild.dev/blog/better-type-safety-for-resolvers-with-graphql-codegen

useIndexSignature boolean

Adds an index signature to any generates resolver. Default value: "false"

noSchemaStitching boolean

Disables/Enables Schema Stitching support. By default, the resolver signature does not include the support for schema-stitching. Set to false to enable that. Default value: "true"

wrapFieldDefinitions boolean

Set to true in order to wrap field definitions with FieldWrapper. This is useful to allow return types such as Promises and functions. Needed for compatibility with federation: true when Default value: "true"

customResolveInfo string

You can provide your custom GraphQLResolveInfo instead of the default one from graphql-js Default value: "graphql#GraphQLResolveInfo"

customResolverFn string

You can provide your custom ResolveFn instead the default. It has to be a type that uses the generics <TResult, TParent, TContext, TArgs> Default value: "(parent: TParent, args: TArgs, context: TContext, info: GraphQLResolveInfo) => Promise | TResult"

directiveResolverMappings __type_1
allowParentTypeOverride boolean

Allow you to override the ParentType generic in each resolver, by avoid enforcing the base type of the generated generic type.

This will generate ParentType = Type instead of ParentType extends Type = Type in each resolver.

optionalInfoArgument boolean

Sets info argument of resolver function to be optional field. Useful for testing.

makeResolverTypeCallable boolean

Set to true in order to allow the Resolver type to be callable

addUnderscoreToArgsType boolean

Adds _ to generated Args types in order to avoid duplicate identifiers.

contextType string

Use this configuration to set a custom type for your context, and it will affect all the resolvers, without the need to override it using generics each time. If you wish to use an external type and import it from another file, you can use add plugin and add the required import statement, or you can use a module#type syntax.

fieldContextTypes string[]
rootValueType string

Use this configuration to set a custom type for the rootValue, and it will affect resolvers of all root types (Query, Mutation and Subscription), without the need to override it using generics each time. If you wish to use an external type and import it from another file, you can use add plugin and add the required import statement, or you can use both module#type or module#namespace#type syntax.

directiveContextTypes string[]
mapperTypeSuffix string

Adds a suffix to the imported names to prevent name clashes.

mappers Record<string, string>

Replaces a GraphQL type usage with a custom type, allowing you to return custom object from your resolvers. You can use both module#type and module#namespace#type syntax.

defaultMapper string

Allow you to set the default mapper when it's not being override by mappers or generics. You can specify a type name, or specify a string in module#type or module#namespace#type format. The default value of mappers is the TypeScript type generated by typescript package.

avoidOptionals AvoidOptionalsConfig | boolean

This will cause the generator to avoid using optionals (?), so all field resolvers must be implemented in order to avoid compilation errors. Default value: "false"

showUnusedMappers boolean

Warns about unused mappers. Default value: "true"

enumValues object | string

A raw configuration for enumValues map - can be represented with a single string value for a file path, a map between enum name and a file path, or a map between enum name and an object with explicit enum values.

resolverTypeWrapperSignature string

Allow you to override resolverTypeWrapper definition. Default value: "Promise | T"

federation boolean

Supports Apollo Federation Default value: "false"

enumPrefix boolean

Allow you to disable prefixing for generated enums, works in combination with typesPrefix. Default value: "true"

enumSuffix boolean

Allow you to disable suffixing for generated enums, works in combination with typesSuffix. Default value: "true"

customDirectives object

Configures behavior for custom directives from various GraphQL libraries.

1 nested properties
semanticNonNull boolean
optionalResolveType boolean

Sets the __resolveType field as optional field. Default value: "false"

immutableTypes boolean

Generates immutable types by adding readonly to properties and uses ReadonlyArray. Default value: "false"

namespacedImportName string

Prefixes all GraphQL related generated types with that value, as namespaces import. You can use this feature to allow separation of plugins to different files. Default value: "''"

resolverTypeSuffix string

Suffix we add to each generated type resolver. Default value: "Resolvers"

allResolversTypeName string

The type name to use when exporting all resolvers signature as unified type. Default value: "Resolvers"

internalResolversPrefix string

Defines the prefix value used for __resolveType and __isTypeOf resolvers. If you are using mercurius-js, please set this field to empty string for better compatibility. Default value: "'__'"

resolversNonOptionalTypename ResolversNonOptionalTypenameConfig | boolean

Makes __typename of resolver mappings non-optional without affecting the base types. Default value: "false"

avoidCheckingAbstractTypesRecursively boolean

If true, recursively goes through all object type's fields, checks if they have abstract types and generates expected types correctly. This may not work for cases where provided default mapper types are also nested e.g. defaultMapper: DeepPartial<{T}> or defaultMapper: Partial<{T}>. Default value: "false"

addInterfaceFieldResolverTypes boolean

If true, add field resolver types to Interfaces. By default, GraphQL Interfaces do not trigger any field resolvers, meaning every implementing type must implement the same resolver for the shared fields.

Some tools provide a way to change the default behaviour by making GraphQL Objects inherit missing resolvers from their Interface types. In these cases, it is fine to turn this option to true.

For example, if you are using @graphql-tools/schema#makeExecutableSchema with inheritResolversFromInterfaces: true, you can make addInterfaceFieldResolverTypes: true as well https://the-guild.dev/graphql/tools/docs/generate-schema#makeexecutableschema Default value: "false"

strictScalars boolean

Makes scalars strict.

If scalars are found in the schema that are not defined in scalars an error will be thrown during codegen. Default value: "false"

defaultScalarType string

Allows you to override the type that unknown scalars will have. Default value: "any"

scalars object | string

Scalars map or a string, a map between the GraphQL scalar name and the identifier that should be used

namingConvention NamingConventionFn_1 | NamingConventionMap_1 | string
typesPrefix string

Prefixes all the generated types. Default value: ""

typesSuffix string

Suffixes all the generated types. Default value: ""

skipTypename boolean

Does not add __typename to the generated types, unless it was specified in the selection set. Default value: "false"

nonOptionalTypename boolean

Automatically adds __typename field to the generated types, even when they are not specified in the selection set, and makes it non-optional Default value: "false"

useTypeImports boolean

Will use import type {} rather than import {} when importing only types. This gives compatibility with TypeScript's "importsNotUsedAsValues": "error" option Default value: "false"

inlineFragmentTypes string

Whether fragment types should be inlined into other operations. "inline" is the default behavior and will perform deep inlining fragment types within operation type definitions. "combine" is the previous behavior that uses fragment type references without inlining the types (and might cause issues with deeply nested fragment that uses list types). "mask" transforms the types for use with fragment masking. Useful when masked types are needed when not using the "client" preset e.g. such as combining it with Apollo Client's data masking feature. Default value: "inline"

emitLegacyCommonJSImports boolean

Emit legacy common js imports. Default it will be true this way it ensure that generated code works with non-compliant bundlers. Default value: "true"

importExtension string[] | string

Append this extension to all imports. Useful for ESM environments that require file extensions in import statements.

extractAllFieldsToTypes boolean

Extract all field types to their own types, instead of inlining them. This helps to reduce type duplication, and makes type errors more readable. It can also significantly reduce the size of the generated code, the generation time, and the typechecking time. Default value: "false"

printFieldsOnNewLines boolean

If you prefer to have each field in generated types printed on a new line, set this to true. This can be useful for improving readability of the resulting types, without resorting to running tools like Prettier on the output. Default value: "false"

includeExternalFragments boolean

Whether to include external fragments in the generated code. External fragments are not defined in the same location as the operation definition. Default value: "false"

ApolloAngularRawPluginConfig object

This plugin generates Apollo services (Query, Mutation and Subscription) with TypeScript typings.

It will generate a strongly typed Angular service for every defined query, mutation or subscription. The generated Angular services are ready to inject and use within your Angular component.

It extends the basic TypeScript plugins: @graphql-codegen/typescript, @graphql-codegen/typescript-operations - and thus shares a similar configuration.

To shed some more light regards this template, it's recommended to go through this article: https://apollo-angular.com/docs/get-started, and to read the Code Generation with Apollo Angular: https://the-guild.dev/blog/apollo-angular-12

apolloAngularVersion number

Version of apollo-angular package Default value: "2"

ngModule string

Allows to define ngModule as part of the plugin's config so it's globally available.

namedClient string

Defined the global value of namedClient.

serviceName string

Defined the global value of serviceName.

serviceProvidedInRoot boolean

Defined the global value of serviceProvidedInRoot.

serviceProvidedIn string

Define the Injector of the SDK class.

sdkClass boolean

Set to true in order to generate a SDK service class that uses all generated services. Default value: "false"

querySuffix string

Allows to define a custom suffix for query operations. Default value: "GQL"

mutationSuffix string

Allows to define a custom suffix for mutation operations. Default value: "GQL"

subscriptionSuffix string

Allows to define a custom suffix for Subscription operations. Default value: "GQL"

apolloAngularPackage string

Allows to define a custom Apollo-Angular package to import types from. Default value: "'apollo-angular'"

additionalDI string[]

Add additional dependency injections for generated services Default value: ""

addExplicitOverride boolean

Add override modifier to make the generated code compatible with the noImplicitOverride option of Typescript v4.3+. Default value: "false"

gqlImport string

Customize from which module will gql be imported from. This is useful if you want to use modules other than graphql-tag, e.g. graphql.macro. Default value: "graphql-tag#gql"

documentNodeImport string

Customize from which module will DocumentNode be imported from. This is useful if you want to use modules other than graphql, e.g. @graphql-typed-document-node. Default value: "graphql#DocumentNode"

noExport boolean

Set this configuration to true if you wish to tell codegen to generate code with no export identifier. Default value: "false"

dedupeOperationSuffix boolean

Set this configuration to true if you wish to make sure to remove duplicate operation name suffix. Default value: "false"

omitOperationSuffix boolean

Set this configuration to true if you wish to disable auto add suffix of operation name, like Query, Mutation, Subscription, Fragment. Default value: "false"

operationResultSuffix string

Adds a suffix to generated operation result type names Default value: ""

documentVariablePrefix string

Changes the GraphQL operations variables prefix. Default value: ""

documentVariableSuffix string

Changes the GraphQL operations variables suffix. Default value: "Document"

fragmentVariablePrefix string

Changes the GraphQL fragments variables prefix. Default value: ""

fragmentVariableSuffix string

Changes the GraphQL fragments variables suffix. Default value: "FragmentDoc"

documentMode string
Values: "documentNode" "documentNodeImportFragments" "external" "graphQLTag" "string"
optimizeDocumentNode boolean

If you are using documentMode: documentNode | documentNodeImportFragments, you can set this to true to apply document optimizations for your GraphQL document. This will remove all "loc" and "description" fields from the compiled document, and will remove all empty arrays (such as directives, arguments and variableDefinitions). Default value: "true"

importOperationTypesFrom string

This config is used internally by presets, but you can use it manually to tell codegen to prefix all base types that it's using. This is useful if you wish to generate base types from typescript-operations plugin into a different file, and import it from there. Default value: ""

importDocumentNodeExternallyFrom string

This config should be used if documentMode is external. This has 2 usage:

  • any string: This would be the path to import document nodes from. This can be used if we want to manually create the document nodes e.g. Use graphql-tag in a separate file and export the generated document
  • 'near-operation-file': This is a special mode that is intended to be used with near-operation-file preset to import document nodes from those files. If these files are .graphql files, we make use of webpack loader. Default value: ""
pureMagicComment boolean

This config adds PURE magic comment to the static variables to enforce treeshaking for your bundler. Default value: "false"

experimentalFragmentVariables boolean

If set to true, it will enable support for parsing variables on fragments. Default value: "false"

strictScalars boolean

Makes scalars strict.

If scalars are found in the schema that are not defined in scalars an error will be thrown during codegen. Default value: "false"

defaultScalarType string

Allows you to override the type that unknown scalars will have. Default value: "any"

scalars object | string

Scalars map or a string, a map between the GraphQL scalar name and the identifier that should be used

namingConvention NamingConventionFn_1 | NamingConventionMap_1 | string
typesPrefix string

Prefixes all the generated types. Default value: ""

typesSuffix string

Suffixes all the generated types. Default value: ""

skipTypename boolean

Does not add __typename to the generated types, unless it was specified in the selection set. Default value: "false"

nonOptionalTypename boolean

Automatically adds __typename field to the generated types, even when they are not specified in the selection set, and makes it non-optional Default value: "false"

useTypeImports boolean

Will use import type {} rather than import {} when importing only types. This gives compatibility with TypeScript's "importsNotUsedAsValues": "error" option Default value: "false"

inlineFragmentTypes string

Whether fragment types should be inlined into other operations. "inline" is the default behavior and will perform deep inlining fragment types within operation type definitions. "combine" is the previous behavior that uses fragment type references without inlining the types (and might cause issues with deeply nested fragment that uses list types). "mask" transforms the types for use with fragment masking. Useful when masked types are needed when not using the "client" preset e.g. such as combining it with Apollo Client's data masking feature. Default value: "inline"

emitLegacyCommonJSImports boolean

Emit legacy common js imports. Default it will be true this way it ensure that generated code works with non-compliant bundlers. Default value: "true"

importExtension string[] | string

Append this extension to all imports. Useful for ESM environments that require file extensions in import statements.

extractAllFieldsToTypes boolean

Extract all field types to their own types, instead of inlining them. This helps to reduce type duplication, and makes type errors more readable. It can also significantly reduce the size of the generated code, the generation time, and the typechecking time. Default value: "false"

printFieldsOnNewLines boolean

If you prefer to have each field in generated types printed on a new line, set this to true. This can be useful for improving readability of the resulting types, without resorting to running tools like Prettier on the output. Default value: "false"

includeExternalFragments boolean

Whether to include external fragments in the generated code. External fragments are not defined in the same location as the operation definition. Default value: "false"

NhostPluginConfig object

This plugin generates the Typescript schema that enables queries and mutations to be typed in the Nhost SDK.

scalars object | string

Scalars map or a string, a map between the GraphQL scalar name and the identifier that should be used

UrqlRawPluginConfig object

This plugin generates urql (https://github.com/FormidableLabs/urql) components and HOC with TypeScript typings.

withComponent boolean

Customized the output by enabling/disabling the generated Component. Default value: "false"

withHooks boolean

Customized the output by enabling/disabling the generated React Hooks. Default value: "true"

urqlImportFrom string

You can specify module that exports components Query, Mutation, Subscription and HOCs This is useful for further abstraction of some common tasks (e.g. error handling). Filepath relative to generated file can be also specified. Default value: "urql"

gqlImport string

Customize from which module will gql be imported from. This is useful if you want to use modules other than graphql-tag, e.g. graphql.macro. Default value: "graphql-tag#gql"

documentNodeImport string

Customize from which module will DocumentNode be imported from. This is useful if you want to use modules other than graphql, e.g. @graphql-typed-document-node. Default value: "graphql#DocumentNode"

noExport boolean

Set this configuration to true if you wish to tell codegen to generate code with no export identifier. Default value: "false"

dedupeOperationSuffix boolean

Set this configuration to true if you wish to make sure to remove duplicate operation name suffix. Default value: "false"

omitOperationSuffix boolean

Set this configuration to true if you wish to disable auto add suffix of operation name, like Query, Mutation, Subscription, Fragment. Default value: "false"

operationResultSuffix string

Adds a suffix to generated operation result type names Default value: ""

documentVariablePrefix string

Changes the GraphQL operations variables prefix. Default value: ""

documentVariableSuffix string

Changes the GraphQL operations variables suffix. Default value: "Document"

fragmentVariablePrefix string

Changes the GraphQL fragments variables prefix. Default value: ""

fragmentVariableSuffix string

Changes the GraphQL fragments variables suffix. Default value: "FragmentDoc"

documentMode string
Values: "documentNode" "documentNodeImportFragments" "external" "graphQLTag" "string"
optimizeDocumentNode boolean

If you are using documentMode: documentNode | documentNodeImportFragments, you can set this to true to apply document optimizations for your GraphQL document. This will remove all "loc" and "description" fields from the compiled document, and will remove all empty arrays (such as directives, arguments and variableDefinitions). Default value: "true"

importOperationTypesFrom string

This config is used internally by presets, but you can use it manually to tell codegen to prefix all base types that it's using. This is useful if you wish to generate base types from typescript-operations plugin into a different file, and import it from there. Default value: ""

importDocumentNodeExternallyFrom string

This config should be used if documentMode is external. This has 2 usage:

  • any string: This would be the path to import document nodes from. This can be used if we want to manually create the document nodes e.g. Use graphql-tag in a separate file and export the generated document
  • 'near-operation-file': This is a special mode that is intended to be used with near-operation-file preset to import document nodes from those files. If these files are .graphql files, we make use of webpack loader. Default value: ""
pureMagicComment boolean

This config adds PURE magic comment to the static variables to enforce treeshaking for your bundler. Default value: "false"

experimentalFragmentVariables boolean

If set to true, it will enable support for parsing variables on fragments. Default value: "false"

strictScalars boolean

Makes scalars strict.

If scalars are found in the schema that are not defined in scalars an error will be thrown during codegen. Default value: "false"

defaultScalarType string

Allows you to override the type that unknown scalars will have. Default value: "any"

scalars object | string

Scalars map or a string, a map between the GraphQL scalar name and the identifier that should be used

namingConvention NamingConventionFn_1 | NamingConventionMap_1 | string
typesPrefix string

Prefixes all the generated types. Default value: ""

typesSuffix string

Suffixes all the generated types. Default value: ""

skipTypename boolean

Does not add __typename to the generated types, unless it was specified in the selection set. Default value: "false"

nonOptionalTypename boolean

Automatically adds __typename field to the generated types, even when they are not specified in the selection set, and makes it non-optional Default value: "false"

useTypeImports boolean

Will use import type {} rather than import {} when importing only types. This gives compatibility with TypeScript's "importsNotUsedAsValues": "error" option Default value: "false"

inlineFragmentTypes string

Whether fragment types should be inlined into other operations. "inline" is the default behavior and will perform deep inlining fragment types within operation type definitions. "combine" is the previous behavior that uses fragment type references without inlining the types (and might cause issues with deeply nested fragment that uses list types). "mask" transforms the types for use with fragment masking. Useful when masked types are needed when not using the "client" preset e.g. such as combining it with Apollo Client's data masking feature. Default value: "inline"

emitLegacyCommonJSImports boolean

Emit legacy common js imports. Default it will be true this way it ensure that generated code works with non-compliant bundlers. Default value: "true"

importExtension string[] | string

Append this extension to all imports. Useful for ESM environments that require file extensions in import statements.

extractAllFieldsToTypes boolean

Extract all field types to their own types, instead of inlining them. This helps to reduce type duplication, and makes type errors more readable. It can also significantly reduce the size of the generated code, the generation time, and the typechecking time. Default value: "false"

printFieldsOnNewLines boolean

If you prefer to have each field in generated types printed on a new line, set this to true. This can be useful for improving readability of the resulting types, without resorting to running tools like Prettier on the output. Default value: "false"

includeExternalFragments boolean

Whether to include external fragments in the generated code. External fragments are not defined in the same location as the operation definition. Default value: "false"

ReactApolloRawPluginConfig object

This plugin generates React Apollo components and HOC with TypeScript typings.

It extends the basic TypeScript plugins: @graphql-codegen/typescript, @graphql-codegen/typescript-operations - and thus shares a similar configuration.

withComponent boolean

Customize the output by enabling/disabling the generated Component (deprecated since Apollo-Client v3). For more details: https://apollographql.com/docs/react/api/react/components Default value: "false"

withHOC boolean

Customize the output by enabling/disabling the HOC (deprecated since Apollo-Client v3). For more details: https://apollographql.com/docs/react/api/react/hoc Default value: "false"

withHooks boolean

Customized the output by enabling/disabling the generated React Hooks. For more details: https://apollographql.com/docs/react/api/react/hooks Default value: "true"

withMutationFn boolean

Customized the output by enabling/disabling the generated mutation function signature. Default value: "true"

withRefetchFn boolean

Enable generating a function to be used with refetchQueries Default value: "false"

apolloReactCommonImportFrom string

Customize the package where apollo-react common lib is loaded from. Default value: "@apollo/react-common"

apolloReactComponentsImportFrom string

Customize the package where apollo-react component lib is loaded from. Default value: "@apollo/react-components"

apolloReactHocImportFrom string

Customize the package where apollo-react HOC lib is loaded from. Default value: "@apollo/react-hoc"

apolloReactHooksImportFrom string

Customize the package where apollo-react hooks lib is loaded from. Default value: "@apollo/react-hooks"

componentSuffix string

You can specify a suffix that gets attached to the name of the generated component. Default value: "Component"

reactApolloVersion number

Sets the version of react-apollo. If you are using the old (deprecated) package of react-apollo, please set this configuration to 2. If you are using Apollo-Client v3, please set this to 3. Default value: "3"

Values: 2 3
withResultType boolean

Customized the output by enabling/disabling the generated result type. Default value: "true"

withMutationOptionsType boolean

Customized the output by enabling/disabling the generated mutation option type. Default value: "true"

withFragmentHooks boolean

Whether or not to include wrappers for Apollo's useFragment hook. Default value: "false"

addDocBlocks boolean

Allows you to enable/disable the generation of docblocks in generated code. Some IDE's (like VSCode) add extra inline information with docblocks, you can disable this feature if your preferred IDE does not. Default value: "true"

defaultBaseOptions Record<string, any>
7 nested properties
awaitRefetchQueries boolean
errorPolicy string
fetchPolicy string
ignoreResults boolean
notifyOnNetworkStatusChange boolean
returnPartialData boolean
ssr boolean
hooksSuffix string
gqlImport string

Customize from which module will gql be imported from. This is useful if you want to use modules other than graphql-tag, e.g. graphql.macro. Default value: "graphql-tag#gql"

documentNodeImport string

Customize from which module will DocumentNode be imported from. This is useful if you want to use modules other than graphql, e.g. @graphql-typed-document-node. Default value: "graphql#DocumentNode"

noExport boolean

Set this configuration to true if you wish to tell codegen to generate code with no export identifier. Default value: "false"

dedupeOperationSuffix boolean

Set this configuration to true if you wish to make sure to remove duplicate operation name suffix. Default value: "false"

omitOperationSuffix boolean

Set this configuration to true if you wish to disable auto add suffix of operation name, like Query, Mutation, Subscription, Fragment. Default value: "false"

operationResultSuffix string

Adds a suffix to generated operation result type names Default value: ""

documentVariablePrefix string

Changes the GraphQL operations variables prefix. Default value: ""

documentVariableSuffix string

Changes the GraphQL operations variables suffix. Default value: "Document"

fragmentVariablePrefix string

Changes the GraphQL fragments variables prefix. Default value: ""

fragmentVariableSuffix string

Changes the GraphQL fragments variables suffix. Default value: "FragmentDoc"

documentMode string
Values: "documentNode" "documentNodeImportFragments" "external" "graphQLTag" "string"
optimizeDocumentNode boolean

If you are using documentMode: documentNode | documentNodeImportFragments, you can set this to true to apply document optimizations for your GraphQL document. This will remove all "loc" and "description" fields from the compiled document, and will remove all empty arrays (such as directives, arguments and variableDefinitions). Default value: "true"

importOperationTypesFrom string

This config is used internally by presets, but you can use it manually to tell codegen to prefix all base types that it's using. This is useful if you wish to generate base types from typescript-operations plugin into a different file, and import it from there. Default value: ""

importDocumentNodeExternallyFrom string

This config should be used if documentMode is external. This has 2 usage:

  • any string: This would be the path to import document nodes from. This can be used if we want to manually create the document nodes e.g. Use graphql-tag in a separate file and export the generated document
  • 'near-operation-file': This is a special mode that is intended to be used with near-operation-file preset to import document nodes from those files. If these files are .graphql files, we make use of webpack loader. Default value: ""
pureMagicComment boolean

This config adds PURE magic comment to the static variables to enforce treeshaking for your bundler. Default value: "false"

experimentalFragmentVariables boolean

If set to true, it will enable support for parsing variables on fragments. Default value: "false"

strictScalars boolean

Makes scalars strict.

If scalars are found in the schema that are not defined in scalars an error will be thrown during codegen. Default value: "false"

defaultScalarType string

Allows you to override the type that unknown scalars will have. Default value: "any"

scalars object | string

Scalars map or a string, a map between the GraphQL scalar name and the identifier that should be used

namingConvention NamingConventionFn_1 | NamingConventionMap_1 | string
typesPrefix string

Prefixes all the generated types. Default value: ""

typesSuffix string

Suffixes all the generated types. Default value: ""

skipTypename boolean

Does not add __typename to the generated types, unless it was specified in the selection set. Default value: "false"

nonOptionalTypename boolean

Automatically adds __typename field to the generated types, even when they are not specified in the selection set, and makes it non-optional Default value: "false"

useTypeImports boolean

Will use import type {} rather than import {} when importing only types. This gives compatibility with TypeScript's "importsNotUsedAsValues": "error" option Default value: "false"

inlineFragmentTypes string

Whether fragment types should be inlined into other operations. "inline" is the default behavior and will perform deep inlining fragment types within operation type definitions. "combine" is the previous behavior that uses fragment type references without inlining the types (and might cause issues with deeply nested fragment that uses list types). "mask" transforms the types for use with fragment masking. Useful when masked types are needed when not using the "client" preset e.g. such as combining it with Apollo Client's data masking feature. Default value: "inline"

emitLegacyCommonJSImports boolean

Emit legacy common js imports. Default it will be true this way it ensure that generated code works with non-compliant bundlers. Default value: "true"

importExtension string[] | string

Append this extension to all imports. Useful for ESM environments that require file extensions in import statements.

extractAllFieldsToTypes boolean

Extract all field types to their own types, instead of inlining them. This helps to reduce type duplication, and makes type errors more readable. It can also significantly reduce the size of the generated code, the generation time, and the typechecking time. Default value: "false"

printFieldsOnNewLines boolean

If you prefer to have each field in generated types printed on a new line, set this to true. This can be useful for improving readability of the resulting types, without resorting to running tools like Prettier on the output. Default value: "false"

includeExternalFragments boolean

Whether to include external fragments in the generated code. External fragments are not defined in the same location as the operation definition. Default value: "false"

VueApolloRawPluginConfig object

This plugin generates

withCompositionFunctions boolean

Customized the output by enabling/disabling the generated Vue composition functions. Default value: "true"

vueApolloComposableImportFrom string

Default value: ""

vueCompositionApiImportFrom string

Default value: ""

addDocBlocks boolean

Allows you to enable/disable the generation of docblocks in generated code. Some IDE's (like VSCode) add extra inline information with docblocks, you can disable this feature if your preferred IDE does not. Default value: "true"

clientId string

Allows you to set the clientId in the composition functions when using multiple apollo clients. Default value: "null"

gqlImport string

Customize from which module will gql be imported from. This is useful if you want to use modules other than graphql-tag, e.g. graphql.macro. Default value: "graphql-tag#gql"

documentNodeImport string

Customize from which module will DocumentNode be imported from. This is useful if you want to use modules other than graphql, e.g. @graphql-typed-document-node. Default value: "graphql#DocumentNode"

noExport boolean

Set this configuration to true if you wish to tell codegen to generate code with no export identifier. Default value: "false"

dedupeOperationSuffix boolean

Set this configuration to true if you wish to make sure to remove duplicate operation name suffix. Default value: "false"

omitOperationSuffix boolean

Set this configuration to true if you wish to disable auto add suffix of operation name, like Query, Mutation, Subscription, Fragment. Default value: "false"

operationResultSuffix string

Adds a suffix to generated operation result type names Default value: ""

documentVariablePrefix string

Changes the GraphQL operations variables prefix. Default value: ""

documentVariableSuffix string

Changes the GraphQL operations variables suffix. Default value: "Document"

fragmentVariablePrefix string

Changes the GraphQL fragments variables prefix. Default value: ""

fragmentVariableSuffix string

Changes the GraphQL fragments variables suffix. Default value: "FragmentDoc"

documentMode string
Values: "documentNode" "documentNodeImportFragments" "external" "graphQLTag" "string"
optimizeDocumentNode boolean

If you are using documentMode: documentNode | documentNodeImportFragments, you can set this to true to apply document optimizations for your GraphQL document. This will remove all "loc" and "description" fields from the compiled document, and will remove all empty arrays (such as directives, arguments and variableDefinitions). Default value: "true"

importOperationTypesFrom string

This config is used internally by presets, but you can use it manually to tell codegen to prefix all base types that it's using. This is useful if you wish to generate base types from typescript-operations plugin into a different file, and import it from there. Default value: ""

importDocumentNodeExternallyFrom string

This config should be used if documentMode is external. This has 2 usage:

  • any string: This would be the path to import document nodes from. This can be used if we want to manually create the document nodes e.g. Use graphql-tag in a separate file and export the generated document
  • 'near-operation-file': This is a special mode that is intended to be used with near-operation-file preset to import document nodes from those files. If these files are .graphql files, we make use of webpack loader. Default value: ""
pureMagicComment boolean

This config adds PURE magic comment to the static variables to enforce treeshaking for your bundler. Default value: "false"

experimentalFragmentVariables boolean

If set to true, it will enable support for parsing variables on fragments. Default value: "false"

strictScalars boolean

Makes scalars strict.

If scalars are found in the schema that are not defined in scalars an error will be thrown during codegen. Default value: "false"

defaultScalarType string

Allows you to override the type that unknown scalars will have. Default value: "any"

scalars object | string

Scalars map or a string, a map between the GraphQL scalar name and the identifier that should be used

namingConvention NamingConventionFn_1 | NamingConventionMap_1 | string
typesPrefix string

Prefixes all the generated types. Default value: ""

typesSuffix string

Suffixes all the generated types. Default value: ""

skipTypename boolean

Does not add __typename to the generated types, unless it was specified in the selection set. Default value: "false"

nonOptionalTypename boolean

Automatically adds __typename field to the generated types, even when they are not specified in the selection set, and makes it non-optional Default value: "false"

useTypeImports boolean

Will use import type {} rather than import {} when importing only types. This gives compatibility with TypeScript's "importsNotUsedAsValues": "error" option Default value: "false"

inlineFragmentTypes string

Whether fragment types should be inlined into other operations. "inline" is the default behavior and will perform deep inlining fragment types within operation type definitions. "combine" is the previous behavior that uses fragment type references without inlining the types (and might cause issues with deeply nested fragment that uses list types). "mask" transforms the types for use with fragment masking. Useful when masked types are needed when not using the "client" preset e.g. such as combining it with Apollo Client's data masking feature. Default value: "inline"

emitLegacyCommonJSImports boolean

Emit legacy common js imports. Default it will be true this way it ensure that generated code works with non-compliant bundlers. Default value: "true"

importExtension string[] | string

Append this extension to all imports. Useful for ESM environments that require file extensions in import statements.

extractAllFieldsToTypes boolean

Extract all field types to their own types, instead of inlining them. This helps to reduce type duplication, and makes type errors more readable. It can also significantly reduce the size of the generated code, the generation time, and the typechecking time. Default value: "false"

printFieldsOnNewLines boolean

If you prefer to have each field in generated types printed on a new line, set this to true. This can be useful for improving readability of the resulting types, without resorting to running tools like Prettier on the output. Default value: "false"

includeExternalFragments boolean

Whether to include external fragments in the generated code. External fragments are not defined in the same location as the operation definition. Default value: "false"

VueApolloSmartOpsRawPluginConfig object

This plugin generates Vue Apollo Smart Query, Smart Subscription and mutation operation functions with TypeScript typings.

This plugin relies on some helper functions and types from the vue-apollo-smart-ops package. That package also adds some optional functionality for improved error handling in Vue Apollo operations which can be configured in the generated code from this plugin.

It extends the basic TypeScript plugins: @graphql-codegen/typescript, @graphql-codegen/typescript-operations - and thus shares a similar configuration.

withSmartOperationFunctions boolean

Customize the output by enabling/disabling the generated Vue Apollo Smart Operations functions. Default value: "true"

vueApolloOperationFunctionsImportFrom string

The typescript-vue-apollo-smart-ops plugin requires three functions that are used to define your query, subscription and mutation operation functions:

  • createMutationFunction
  • createSmartQueryOptionsFunction
  • createSmartSubscriptionOptionsFunction

By default, these functions are provided by the vue-apollo-smart-ops package, but you can substitute your own import path if you want to replace them with other implementations. Default value: "vue-apollo-smart-ops"

vueApolloErrorType string

The operation functions generated by typescript-vue-apollo-smart-ops include some functionality for error handling. This configuration parameter allows you to customise the name of the error type that will be used. The default is to use ApolloError from the apollo-client package. Default value: "ApolloError"

vueApolloErrorTypeImportFrom string

The operation functions generated by typescript-vue-apollo-smart-ops include some functionality for error handling. This configuration parameter allows you to customise the package where the error type will be imported from. The default is to use ApolloError from the apollo-client package. Default value: "vue-apollo-smart-ops"

vueApolloErrorHandlerFunction string

The operation functions generated by typescript-vue-apollo-smart-ops include some functionality for error handling. You may supply an error handler function that will be called when an error occurs in a query, subscription or mutation operation. This function should implement the ApolloOperationErrorHandlerFunction interface from vue-apollo-smart-ops package. You can have a custom handler in your app that shows a notification to the user, for example. If unspecified, this functionality will be disabled and errors handled (or not) by Vue Apollo in the normal way. Default value: "undefined"

vueApolloErrorHandlerFunctionImportFrom string

The import path where vueApolloErrorHandlerFunction should be imported from. Can be a package name or a local file path (anything that works in an import statement). Default value: "undefined"

vueAppType string

The operation functions generated by typescript-vue-apollo-smart-ops include some functionality for error handling. When an error occurs, the Vue app instance is passed to the error handler. You can customise the expected type of the app object. For example, a Nuxt.js app might use NuxtApp from @nuxt/types/app instead. When unspecified, the default type is Vue from vue/types/vue. Default value: "undefined"

vueAppTypeImportFrom string

The import path where vueAppType should be imported from. Can be a package name or a local file path (anything that works in an import statement). Default value: "undefined"

addDocBlocks boolean

Allows you to enable/disable the generation of docblocks in generated code. Some IDE's (like VSCode) add extra inline information with docblocks, you can disable this feature if your preferred IDE does not. Default value: "true"

gqlImport string

Customize from which module will gql be imported from. This is useful if you want to use modules other than graphql-tag, e.g. graphql.macro. Default value: "graphql-tag#gql"

documentNodeImport string

Customize from which module will DocumentNode be imported from. This is useful if you want to use modules other than graphql, e.g. @graphql-typed-document-node. Default value: "graphql#DocumentNode"

noExport boolean

Set this configuration to true if you wish to tell codegen to generate code with no export identifier. Default value: "false"

dedupeOperationSuffix boolean

Set this configuration to true if you wish to make sure to remove duplicate operation name suffix. Default value: "false"

omitOperationSuffix boolean

Set this configuration to true if you wish to disable auto add suffix of operation name, like Query, Mutation, Subscription, Fragment. Default value: "false"

operationResultSuffix string

Adds a suffix to generated operation result type names Default value: ""

documentVariablePrefix string

Changes the GraphQL operations variables prefix. Default value: ""

documentVariableSuffix string

Changes the GraphQL operations variables suffix. Default value: "Document"

fragmentVariablePrefix string

Changes the GraphQL fragments variables prefix. Default value: ""

fragmentVariableSuffix string

Changes the GraphQL fragments variables suffix. Default value: "FragmentDoc"

documentMode string
Values: "documentNode" "documentNodeImportFragments" "external" "graphQLTag" "string"
optimizeDocumentNode boolean

If you are using documentMode: documentNode | documentNodeImportFragments, you can set this to true to apply document optimizations for your GraphQL document. This will remove all "loc" and "description" fields from the compiled document, and will remove all empty arrays (such as directives, arguments and variableDefinitions). Default value: "true"

importOperationTypesFrom string

This config is used internally by presets, but you can use it manually to tell codegen to prefix all base types that it's using. This is useful if you wish to generate base types from typescript-operations plugin into a different file, and import it from there. Default value: ""

importDocumentNodeExternallyFrom string

This config should be used if documentMode is external. This has 2 usage:

  • any string: This would be the path to import document nodes from. This can be used if we want to manually create the document nodes e.g. Use graphql-tag in a separate file and export the generated document
  • 'near-operation-file': This is a special mode that is intended to be used with near-operation-file preset to import document nodes from those files. If these files are .graphql files, we make use of webpack loader. Default value: ""
pureMagicComment boolean

This config adds PURE magic comment to the static variables to enforce treeshaking for your bundler. Default value: "false"

experimentalFragmentVariables boolean

If set to true, it will enable support for parsing variables on fragments. Default value: "false"

strictScalars boolean

Makes scalars strict.

If scalars are found in the schema that are not defined in scalars an error will be thrown during codegen. Default value: "false"

defaultScalarType string

Allows you to override the type that unknown scalars will have. Default value: "any"

scalars object | string

Scalars map or a string, a map between the GraphQL scalar name and the identifier that should be used

namingConvention NamingConventionFn_1 | NamingConventionMap_1 | string
typesPrefix string

Prefixes all the generated types. Default value: ""

typesSuffix string

Suffixes all the generated types. Default value: ""

skipTypename boolean

Does not add __typename to the generated types, unless it was specified in the selection set. Default value: "false"

nonOptionalTypename boolean

Automatically adds __typename field to the generated types, even when they are not specified in the selection set, and makes it non-optional Default value: "false"

useTypeImports boolean

Will use import type {} rather than import {} when importing only types. This gives compatibility with TypeScript's "importsNotUsedAsValues": "error" option Default value: "false"

inlineFragmentTypes string

Whether fragment types should be inlined into other operations. "inline" is the default behavior and will perform deep inlining fragment types within operation type definitions. "combine" is the previous behavior that uses fragment type references without inlining the types (and might cause issues with deeply nested fragment that uses list types). "mask" transforms the types for use with fragment masking. Useful when masked types are needed when not using the "client" preset e.g. such as combining it with Apollo Client's data masking feature. Default value: "inline"

emitLegacyCommonJSImports boolean

Emit legacy common js imports. Default it will be true this way it ensure that generated code works with non-compliant bundlers. Default value: "true"

importExtension string[] | string

Append this extension to all imports. Useful for ESM environments that require file extensions in import statements.

extractAllFieldsToTypes boolean

Extract all field types to their own types, instead of inlining them. This helps to reduce type duplication, and makes type errors more readable. It can also significantly reduce the size of the generated code, the generation time, and the typechecking time. Default value: "false"

printFieldsOnNewLines boolean

If you prefer to have each field in generated types printed on a new line, set this to true. This can be useful for improving readability of the resulting types, without resorting to running tools like Prettier on the output. Default value: "false"

includeExternalFragments boolean

Whether to include external fragments in the generated code. External fragments are not defined in the same location as the operation definition. Default value: "false"

VueUrqlRawPluginConfig object

This plugin generates urql (https://github.com/FormidableLabs/urql) composition functions with TypeScript typings.

withComposition boolean

Customized the output by enabling/disabling the generated Vue Composition functions. Default value: "true"

urqlImportFrom string

You can specify module that exports components Query, Mutation, Subscription This is useful for further abstraction of some common tasks (e.g. error handling). Filepath relative to generated file can be also specified. Default value: "urql"

gqlImport string

Customize from which module will gql be imported from. This is useful if you want to use modules other than graphql-tag, e.g. graphql.macro. Default value: "graphql-tag#gql"

documentNodeImport string

Customize from which module will DocumentNode be imported from. This is useful if you want to use modules other than graphql, e.g. @graphql-typed-document-node. Default value: "graphql#DocumentNode"

noExport boolean

Set this configuration to true if you wish to tell codegen to generate code with no export identifier. Default value: "false"

dedupeOperationSuffix boolean

Set this configuration to true if you wish to make sure to remove duplicate operation name suffix. Default value: "false"

omitOperationSuffix boolean

Set this configuration to true if you wish to disable auto add suffix of operation name, like Query, Mutation, Subscription, Fragment. Default value: "false"

operationResultSuffix string

Adds a suffix to generated operation result type names Default value: ""

documentVariablePrefix string

Changes the GraphQL operations variables prefix. Default value: ""

documentVariableSuffix string

Changes the GraphQL operations variables suffix. Default value: "Document"

fragmentVariablePrefix string

Changes the GraphQL fragments variables prefix. Default value: ""

fragmentVariableSuffix string

Changes the GraphQL fragments variables suffix. Default value: "FragmentDoc"

documentMode string
Values: "documentNode" "documentNodeImportFragments" "external" "graphQLTag" "string"
optimizeDocumentNode boolean

If you are using documentMode: documentNode | documentNodeImportFragments, you can set this to true to apply document optimizations for your GraphQL document. This will remove all "loc" and "description" fields from the compiled document, and will remove all empty arrays (such as directives, arguments and variableDefinitions). Default value: "true"

importOperationTypesFrom string

This config is used internally by presets, but you can use it manually to tell codegen to prefix all base types that it's using. This is useful if you wish to generate base types from typescript-operations plugin into a different file, and import it from there. Default value: ""

importDocumentNodeExternallyFrom string

This config should be used if documentMode is external. This has 2 usage:

  • any string: This would be the path to import document nodes from. This can be used if we want to manually create the document nodes e.g. Use graphql-tag in a separate file and export the generated document
  • 'near-operation-file': This is a special mode that is intended to be used with near-operation-file preset to import document nodes from those files. If these files are .graphql files, we make use of webpack loader. Default value: ""
pureMagicComment boolean

This config adds PURE magic comment to the static variables to enforce treeshaking for your bundler. Default value: "false"

experimentalFragmentVariables boolean

If set to true, it will enable support for parsing variables on fragments. Default value: "false"

strictScalars boolean

Makes scalars strict.

If scalars are found in the schema that are not defined in scalars an error will be thrown during codegen. Default value: "false"

defaultScalarType string

Allows you to override the type that unknown scalars will have. Default value: "any"

scalars object | string

Scalars map or a string, a map between the GraphQL scalar name and the identifier that should be used

namingConvention NamingConventionFn_1 | NamingConventionMap_1 | string
typesPrefix string

Prefixes all the generated types. Default value: ""

typesSuffix string

Suffixes all the generated types. Default value: ""

skipTypename boolean

Does not add __typename to the generated types, unless it was specified in the selection set. Default value: "false"

nonOptionalTypename boolean

Automatically adds __typename field to the generated types, even when they are not specified in the selection set, and makes it non-optional Default value: "false"

useTypeImports boolean

Will use import type {} rather than import {} when importing only types. This gives compatibility with TypeScript's "importsNotUsedAsValues": "error" option Default value: "false"

inlineFragmentTypes string

Whether fragment types should be inlined into other operations. "inline" is the default behavior and will perform deep inlining fragment types within operation type definitions. "combine" is the previous behavior that uses fragment type references without inlining the types (and might cause issues with deeply nested fragment that uses list types). "mask" transforms the types for use with fragment masking. Useful when masked types are needed when not using the "client" preset e.g. such as combining it with Apollo Client's data masking feature. Default value: "inline"

emitLegacyCommonJSImports boolean

Emit legacy common js imports. Default it will be true this way it ensure that generated code works with non-compliant bundlers. Default value: "true"

importExtension string[] | string

Append this extension to all imports. Useful for ESM environments that require file extensions in import statements.

extractAllFieldsToTypes boolean

Extract all field types to their own types, instead of inlining them. This helps to reduce type duplication, and makes type errors more readable. It can also significantly reduce the size of the generated code, the generation time, and the typechecking time. Default value: "false"

printFieldsOnNewLines boolean

If you prefer to have each field in generated types printed on a new line, set this to true. This can be useful for improving readability of the resulting types, without resorting to running tools like Prettier on the output. Default value: "false"

includeExternalFragments boolean

Whether to include external fragments in the generated code. External fragments are not defined in the same location as the operation definition. Default value: "false"

StencilApolloRawPluginConfig object

This plugin generates Stencil Apollo functional components typings

It extends the basic TypeScript plugins: @graphql-codegen/typescript, @graphql-codegen/typescript-operations - and thus shares a similar configuration.

componentType string
Values: "class" "functional"
gqlImport string

Customize from which module will gql be imported from. This is useful if you want to use modules other than graphql-tag, e.g. graphql.macro. Default value: "graphql-tag#gql"

documentNodeImport string

Customize from which module will DocumentNode be imported from. This is useful if you want to use modules other than graphql, e.g. @graphql-typed-document-node. Default value: "graphql#DocumentNode"

noExport boolean

Set this configuration to true if you wish to tell codegen to generate code with no export identifier. Default value: "false"

dedupeOperationSuffix boolean

Set this configuration to true if you wish to make sure to remove duplicate operation name suffix. Default value: "false"

omitOperationSuffix boolean

Set this configuration to true if you wish to disable auto add suffix of operation name, like Query, Mutation, Subscription, Fragment. Default value: "false"

operationResultSuffix string

Adds a suffix to generated operation result type names Default value: ""

documentVariablePrefix string

Changes the GraphQL operations variables prefix. Default value: ""

documentVariableSuffix string

Changes the GraphQL operations variables suffix. Default value: "Document"

fragmentVariablePrefix string

Changes the GraphQL fragments variables prefix. Default value: ""

fragmentVariableSuffix string

Changes the GraphQL fragments variables suffix. Default value: "FragmentDoc"

documentMode string
Values: "documentNode" "documentNodeImportFragments" "external" "graphQLTag" "string"
optimizeDocumentNode boolean

If you are using documentMode: documentNode | documentNodeImportFragments, you can set this to true to apply document optimizations for your GraphQL document. This will remove all "loc" and "description" fields from the compiled document, and will remove all empty arrays (such as directives, arguments and variableDefinitions). Default value: "true"

importOperationTypesFrom string

This config is used internally by presets, but you can use it manually to tell codegen to prefix all base types that it's using. This is useful if you wish to generate base types from typescript-operations plugin into a different file, and import it from there. Default value: ""

importDocumentNodeExternallyFrom string

This config should be used if documentMode is external. This has 2 usage:

  • any string: This would be the path to import document nodes from. This can be used if we want to manually create the document nodes e.g. Use graphql-tag in a separate file and export the generated document
  • 'near-operation-file': This is a special mode that is intended to be used with near-operation-file preset to import document nodes from those files. If these files are .graphql files, we make use of webpack loader. Default value: ""
pureMagicComment boolean

This config adds PURE magic comment to the static variables to enforce treeshaking for your bundler. Default value: "false"

experimentalFragmentVariables boolean

If set to true, it will enable support for parsing variables on fragments. Default value: "false"

strictScalars boolean

Makes scalars strict.

If scalars are found in the schema that are not defined in scalars an error will be thrown during codegen. Default value: "false"

defaultScalarType string

Allows you to override the type that unknown scalars will have. Default value: "any"

scalars object | string

Scalars map or a string, a map between the GraphQL scalar name and the identifier that should be used

namingConvention NamingConventionFn_1 | NamingConventionMap_1 | string
typesPrefix string

Prefixes all the generated types. Default value: ""

typesSuffix string

Suffixes all the generated types. Default value: ""

skipTypename boolean

Does not add __typename to the generated types, unless it was specified in the selection set. Default value: "false"

nonOptionalTypename boolean

Automatically adds __typename field to the generated types, even when they are not specified in the selection set, and makes it non-optional Default value: "false"

useTypeImports boolean

Will use import type {} rather than import {} when importing only types. This gives compatibility with TypeScript's "importsNotUsedAsValues": "error" option Default value: "false"

inlineFragmentTypes string

Whether fragment types should be inlined into other operations. "inline" is the default behavior and will perform deep inlining fragment types within operation type definitions. "combine" is the previous behavior that uses fragment type references without inlining the types (and might cause issues with deeply nested fragment that uses list types). "mask" transforms the types for use with fragment masking. Useful when masked types are needed when not using the "client" preset e.g. such as combining it with Apollo Client's data masking feature. Default value: "inline"

emitLegacyCommonJSImports boolean

Emit legacy common js imports. Default it will be true this way it ensure that generated code works with non-compliant bundlers. Default value: "true"

importExtension string[] | string

Append this extension to all imports. Useful for ESM environments that require file extensions in import statements.

extractAllFieldsToTypes boolean

Extract all field types to their own types, instead of inlining them. This helps to reduce type duplication, and makes type errors more readable. It can also significantly reduce the size of the generated code, the generation time, and the typechecking time. Default value: "false"

printFieldsOnNewLines boolean

If you prefer to have each field in generated types printed on a new line, set this to true. This can be useful for improving readability of the resulting types, without resorting to running tools like Prettier on the output. Default value: "false"

includeExternalFragments boolean

Whether to include external fragments in the generated code. External fragments are not defined in the same location as the operation definition. Default value: "false"

TypeScriptDocumentNodesRawPluginConfig object

This plugin generates TypeScript source .ts file from GraphQL files .graphql.

namingConvention NamingConventionFn_1 | NamingConventionMap_1 | string
namePrefix string

Adds prefix to the name Default value: ""

nameSuffix string

Adds suffix to the name Default value: ""

fragmentPrefix string

Adds prefix to the fragment variable Default value: ""

fragmentSuffix string

Adds suffix to the fragment variable Default value: ""

gqlImport string

Customize from which module will gql be imported from. This is useful if you want to use modules other than graphql-tag, e.g. graphql.macro. Default value: "graphql-tag#gql"

documentNodeImport string

Customize from which module will DocumentNode be imported from. This is useful if you want to use modules other than graphql, e.g. @graphql-typed-document-node. Default value: "graphql#DocumentNode"

noExport boolean

Set this configuration to true if you wish to tell codegen to generate code with no export identifier. Default value: "false"

dedupeOperationSuffix boolean

Set this configuration to true if you wish to make sure to remove duplicate operation name suffix. Default value: "false"

omitOperationSuffix boolean

Set this configuration to true if you wish to disable auto add suffix of operation name, like Query, Mutation, Subscription, Fragment. Default value: "false"

operationResultSuffix string

Adds a suffix to generated operation result type names Default value: ""

documentVariablePrefix string

Changes the GraphQL operations variables prefix. Default value: ""

documentVariableSuffix string

Changes the GraphQL operations variables suffix. Default value: "Document"

fragmentVariablePrefix string

Changes the GraphQL fragments variables prefix. Default value: ""

fragmentVariableSuffix string

Changes the GraphQL fragments variables suffix. Default value: "FragmentDoc"

documentMode string
Values: "documentNode" "documentNodeImportFragments" "external" "graphQLTag" "string"
optimizeDocumentNode boolean

If you are using documentMode: documentNode | documentNodeImportFragments, you can set this to true to apply document optimizations for your GraphQL document. This will remove all "loc" and "description" fields from the compiled document, and will remove all empty arrays (such as directives, arguments and variableDefinitions). Default value: "true"

importOperationTypesFrom string

This config is used internally by presets, but you can use it manually to tell codegen to prefix all base types that it's using. This is useful if you wish to generate base types from typescript-operations plugin into a different file, and import it from there. Default value: ""

importDocumentNodeExternallyFrom string

This config should be used if documentMode is external. This has 2 usage:

  • any string: This would be the path to import document nodes from. This can be used if we want to manually create the document nodes e.g. Use graphql-tag in a separate file and export the generated document
  • 'near-operation-file': This is a special mode that is intended to be used with near-operation-file preset to import document nodes from those files. If these files are .graphql files, we make use of webpack loader. Default value: ""
pureMagicComment boolean

This config adds PURE magic comment to the static variables to enforce treeshaking for your bundler. Default value: "false"

experimentalFragmentVariables boolean

If set to true, it will enable support for parsing variables on fragments. Default value: "false"

strictScalars boolean

Makes scalars strict.

If scalars are found in the schema that are not defined in scalars an error will be thrown during codegen. Default value: "false"

defaultScalarType string

Allows you to override the type that unknown scalars will have. Default value: "any"

scalars object | string

Scalars map or a string, a map between the GraphQL scalar name and the identifier that should be used

typesPrefix string

Prefixes all the generated types. Default value: ""

typesSuffix string

Suffixes all the generated types. Default value: ""

skipTypename boolean

Does not add __typename to the generated types, unless it was specified in the selection set. Default value: "false"

nonOptionalTypename boolean

Automatically adds __typename field to the generated types, even when they are not specified in the selection set, and makes it non-optional Default value: "false"

useTypeImports boolean

Will use import type {} rather than import {} when importing only types. This gives compatibility with TypeScript's "importsNotUsedAsValues": "error" option Default value: "false"

inlineFragmentTypes string

Whether fragment types should be inlined into other operations. "inline" is the default behavior and will perform deep inlining fragment types within operation type definitions. "combine" is the previous behavior that uses fragment type references without inlining the types (and might cause issues with deeply nested fragment that uses list types). "mask" transforms the types for use with fragment masking. Useful when masked types are needed when not using the "client" preset e.g. such as combining it with Apollo Client's data masking feature. Default value: "inline"

emitLegacyCommonJSImports boolean

Emit legacy common js imports. Default it will be true this way it ensure that generated code works with non-compliant bundlers. Default value: "true"

importExtension string[] | string

Append this extension to all imports. Useful for ESM environments that require file extensions in import statements.

extractAllFieldsToTypes boolean

Extract all field types to their own types, instead of inlining them. This helps to reduce type duplication, and makes type errors more readable. It can also significantly reduce the size of the generated code, the generation time, and the typechecking time. Default value: "false"

printFieldsOnNewLines boolean

If you prefer to have each field in generated types printed on a new line, set this to true. This can be useful for improving readability of the resulting types, without resorting to running tools like Prettier on the output. Default value: "false"

includeExternalFragments boolean

Whether to include external fragments in the generated code. External fragments are not defined in the same location as the operation definition. Default value: "false"

MSWConfig object

This plugin generates msw (https://github.com/mswjs/msw) mock handlers with TypeScript typings.

link object

GraphQL endpoint to use when working with multiple backends.

3 nested properties
endpoint string
name string
withSuffix boolean
JavaApolloAndroidPluginConfig object

This plugin and presets creates generated mappers and parsers for a complete type-safe GraphQL requests, for developers that uses Apollo Android runtime.

package string

Customize the Java package name for the generated operations. The default package name will be generated according to the output file path.

typePackage string

Customize the Java package name for the types generated based on input types.

fragmentPackage string

Customize the Java package name for the fragments generated classes.

fileType number
Values: 0 1 2 3
strictScalars boolean

Makes scalars strict.

If scalars are found in the schema that are not defined in scalars an error will be thrown during codegen. Default value: "false"

defaultScalarType string

Allows you to override the type that unknown scalars will have. Default value: "any"

scalars object | string

Scalars map or a string, a map between the GraphQL scalar name and the identifier that should be used

namingConvention NamingConventionFn_1 | NamingConventionMap_1 | string
typesPrefix string

Prefixes all the generated types. Default value: ""

typesSuffix string

Suffixes all the generated types. Default value: ""

skipTypename boolean

Does not add __typename to the generated types, unless it was specified in the selection set. Default value: "false"

nonOptionalTypename boolean

Automatically adds __typename field to the generated types, even when they are not specified in the selection set, and makes it non-optional Default value: "false"

useTypeImports boolean

Will use import type {} rather than import {} when importing only types. This gives compatibility with TypeScript's "importsNotUsedAsValues": "error" option Default value: "false"

inlineFragmentTypes string

Whether fragment types should be inlined into other operations. "inline" is the default behavior and will perform deep inlining fragment types within operation type definitions. "combine" is the previous behavior that uses fragment type references without inlining the types (and might cause issues with deeply nested fragment that uses list types). "mask" transforms the types for use with fragment masking. Useful when masked types are needed when not using the "client" preset e.g. such as combining it with Apollo Client's data masking feature. Default value: "inline"

emitLegacyCommonJSImports boolean

Emit legacy common js imports. Default it will be true this way it ensure that generated code works with non-compliant bundlers. Default value: "true"

importExtension string[] | string

Append this extension to all imports. Useful for ESM environments that require file extensions in import statements.

extractAllFieldsToTypes boolean

Extract all field types to their own types, instead of inlining them. This helps to reduce type duplication, and makes type errors more readable. It can also significantly reduce the size of the generated code, the generation time, and the typechecking time. Default value: "false"

printFieldsOnNewLines boolean

If you prefer to have each field in generated types printed on a new line, set this to true. This can be useful for improving readability of the resulting types, without resorting to running tools like Prettier on the output. Default value: "false"

includeExternalFragments boolean

Whether to include external fragments in the generated code. External fragments are not defined in the same location as the operation definition. Default value: "false"

JavaResolversPluginRawConfig object
package string

Customize the Java package name. The default package name will be generated according to the output file path.

mappers Record<string, string>

Allow you to replace specific GraphQL types with your custom model classes. This is useful when you want to make sure your resolvers returns the correct class. The default value is the values set by defaultMapper configuration. You can use a direct path to the package, or use package#class syntax to have it imported.

defaultMapper string

Sets the default mapper value in case it's not specified by mappers. You can use a direct path to the package, or use package#class syntax to have it imported. The default mapper is Java's Object. Default value: "Object"

className string

Allow you to customize the parent class name. Default value: "Resolvers"

listType string

Allow you to customize the list type. Default value: "Iterable"

strictScalars boolean

Makes scalars strict.

If scalars are found in the schema that are not defined in scalars an error will be thrown during codegen. Default value: "false"

defaultScalarType string

Allows you to override the type that unknown scalars will have. Default value: "any"

scalars object | string

Scalars map or a string, a map between the GraphQL scalar name and the identifier that should be used

namingConvention NamingConventionFn_1 | NamingConventionMap_1 | string
typesPrefix string

Prefixes all the generated types. Default value: ""

typesSuffix string

Suffixes all the generated types. Default value: ""

skipTypename boolean

Does not add __typename to the generated types, unless it was specified in the selection set. Default value: "false"

nonOptionalTypename boolean

Automatically adds __typename field to the generated types, even when they are not specified in the selection set, and makes it non-optional Default value: "false"

useTypeImports boolean

Will use import type {} rather than import {} when importing only types. This gives compatibility with TypeScript's "importsNotUsedAsValues": "error" option Default value: "false"

inlineFragmentTypes string

Whether fragment types should be inlined into other operations. "inline" is the default behavior and will perform deep inlining fragment types within operation type definitions. "combine" is the previous behavior that uses fragment type references without inlining the types (and might cause issues with deeply nested fragment that uses list types). "mask" transforms the types for use with fragment masking. Useful when masked types are needed when not using the "client" preset e.g. such as combining it with Apollo Client's data masking feature. Default value: "inline"

emitLegacyCommonJSImports boolean

Emit legacy common js imports. Default it will be true this way it ensure that generated code works with non-compliant bundlers. Default value: "true"

importExtension string[] | string

Append this extension to all imports. Useful for ESM environments that require file extensions in import statements.

extractAllFieldsToTypes boolean

Extract all field types to their own types, instead of inlining them. This helps to reduce type duplication, and makes type errors more readable. It can also significantly reduce the size of the generated code, the generation time, and the typechecking time. Default value: "false"

printFieldsOnNewLines boolean

If you prefer to have each field in generated types printed on a new line, set this to true. This can be useful for improving readability of the resulting types, without resorting to running tools like Prettier on the output. Default value: "false"

includeExternalFragments boolean

Whether to include external fragments in the generated code. External fragments are not defined in the same location as the operation definition. Default value: "false"

KotlinResolversPluginRawConfig object
package string

Customize the Java package name. The default package name will be generated according to the output file path.

enumValues object | string

A raw configuration for enumValues map - can be represented with a single string value for a file path, a map between enum name and a file path, or a map between enum name and an object with explicit enum values.

listType string

Allow you to customize the list type Default value: "Iterable"

withTypes boolean

Allow you to enable generation for the types Default value: "false"

omitJvmStatic boolean

Allow you to omit JvmStatic annotation Default value: "false"

strictScalars boolean

Makes scalars strict.

If scalars are found in the schema that are not defined in scalars an error will be thrown during codegen. Default value: "false"

defaultScalarType string

Allows you to override the type that unknown scalars will have. Default value: "any"

scalars object | string

Scalars map or a string, a map between the GraphQL scalar name and the identifier that should be used

namingConvention NamingConventionFn_1 | NamingConventionMap_1 | string
typesPrefix string

Prefixes all the generated types. Default value: ""

typesSuffix string

Suffixes all the generated types. Default value: ""

skipTypename boolean

Does not add __typename to the generated types, unless it was specified in the selection set. Default value: "false"

nonOptionalTypename boolean

Automatically adds __typename field to the generated types, even when they are not specified in the selection set, and makes it non-optional Default value: "false"

useTypeImports boolean

Will use import type {} rather than import {} when importing only types. This gives compatibility with TypeScript's "importsNotUsedAsValues": "error" option Default value: "false"

inlineFragmentTypes string

Whether fragment types should be inlined into other operations. "inline" is the default behavior and will perform deep inlining fragment types within operation type definitions. "combine" is the previous behavior that uses fragment type references without inlining the types (and might cause issues with deeply nested fragment that uses list types). "mask" transforms the types for use with fragment masking. Useful when masked types are needed when not using the "client" preset e.g. such as combining it with Apollo Client's data masking feature. Default value: "inline"

emitLegacyCommonJSImports boolean

Emit legacy common js imports. Default it will be true this way it ensure that generated code works with non-compliant bundlers. Default value: "true"

importExtension string[] | string

Append this extension to all imports. Useful for ESM environments that require file extensions in import statements.

extractAllFieldsToTypes boolean

Extract all field types to their own types, instead of inlining them. This helps to reduce type duplication, and makes type errors more readable. It can also significantly reduce the size of the generated code, the generation time, and the typechecking time. Default value: "false"

printFieldsOnNewLines boolean

If you prefer to have each field in generated types printed on a new line, set this to true. This can be useful for improving readability of the resulting types, without resorting to running tools like Prettier on the output. Default value: "false"

includeExternalFragments boolean

Whether to include external fragments in the generated code. External fragments are not defined in the same location as the operation definition. Default value: "false"

FlowPluginConfig object

This plugin generates Flow types based on your GraphQLSchema.

It generates types for your entire schema: types, input types, enum, interface, scalar and union.

useFlowExactObjects boolean

Generates Flow types as Exact types. Default value: "true"

useFlowReadOnlyTypes boolean

Generates read-only Flow types Default value: "false"

addUnderscoreToArgsType boolean

Adds _ to generated Args types in order to avoid duplicate identifiers.

enumValues object | string

A raw configuration for enumValues map - can be represented with a single string value for a file path, a map between enum name and a file path, or a map between enum name and an object with explicit enum values.

declarationKind DeclarationKindConfig_1 | string

Overrides the default output for various GraphQL elements.

enumPrefix boolean

Allow you to disable prefixing for generated enums, works in combination with typesPrefix. Default value: "true"

fieldWrapperValue string

Allow you to add wrapper for field type, use T as the generic value. Make sure to set wrapFieldDefinitions to true in order to make this flag work. Default value: "T"

wrapFieldDefinitions boolean

Set to true in order to wrap field definitions with FieldWrapper. This is useful to allow return types such as Promises and functions. Default value: "false"

onlyEnums boolean

This will cause the generator to emit types for enums only Default value: "false"

onlyOperationTypes boolean

This will cause the generator to emit types for operations only (basically only enums and scalars) Default value: "false"

ignoreEnumValuesFromSchema boolean

This will cause the generator to ignore enum values defined in GraphQLSchema Default value: "false"

wrapEntireFieldDefinitions boolean

Set to true in order to wrap field definitions with EntireFieldWrapper. This is useful to allow return types such as Promises and functions for fields. Differs from wrapFieldDefinitions in that this wraps the entire field definition if i.e. the field is an Array, while wrapFieldDefinitions will wrap every single value inside the array. Default value: "true"

entireFieldWrapperValue string

Allow to override the type value of EntireFieldWrapper. This wrapper applies outside of Array and Maybe unlike fieldWrapperValue, that will wrap the inner type. Default value: "T | Promise | (() => T | Promise)"

directiveArgumentAndInputFieldMappings __type_17
directiveArgumentAndInputFieldMappingTypeSuffix string

Adds a suffix to the imported names to prevent name clashes.

strictScalars boolean

Makes scalars strict.

If scalars are found in the schema that are not defined in scalars an error will be thrown during codegen. Default value: "false"

defaultScalarType string

Allows you to override the type that unknown scalars will have. Default value: "any"

scalars object | string

Scalars map or a string, a map between the GraphQL scalar name and the identifier that should be used

namingConvention NamingConventionFn_2 | NamingConventionMap_2 | string
typesPrefix string

Prefixes all the generated types. Default value: ""

typesSuffix string

Suffixes all the generated types. Default value: ""

skipTypename boolean

Does not add __typename to the generated types, unless it was specified in the selection set. Default value: "false"

nonOptionalTypename boolean

Automatically adds __typename field to the generated types, even when they are not specified in the selection set, and makes it non-optional Default value: "false"

useTypeImports boolean

Will use import type {} rather than import {} when importing only types. This gives compatibility with TypeScript's "importsNotUsedAsValues": "error" option Default value: "false"

dedupeFragments boolean

Removes fragment duplicates for reducing data transfer. It is done by removing sub-fragments imports from fragment definition Instead - all of them are imported to the Operation node. Default value: "false"

inlineFragmentTypes string

Whether fragment types should be inlined into other operations. "inline" is the default behavior and will perform deep inlining fragment types within operation type definitions. "combine" is the previous behavior that uses fragment type references without inlining the types (and might cause issues with deeply nested fragment that uses list types). Default value: "inline"

emitLegacyCommonJSImports boolean

Emit legacy common js imports. Default it will be true this way it ensure that generated code works with non-compliant bundlers. Default value: "true"

FlowResolversPluginConfig object

This plugin generates resolvers signature based on your GraphQLSchema.

It generates types for your entire schema: types, input types, enum, interface, scalar and union.

This plugin requires you to use @graphql-codegen/flow as well, because it depends on it's types.

addUnderscoreToArgsType boolean

Adds _ to generated Args types in order to avoid duplicate identifiers.

contextType string

Use this configuration to set a custom type for your context, and it will affect all the resolvers, without the need to override it using generics each time. If you wish to use an external type and import it from another file, you can use add plugin and add the required import statement, or you can use a module#type syntax.

fieldContextTypes string[]
rootValueType string

Use this configuration to set a custom type for the rootValue, and it will affect resolvers of all root types (Query, Mutation and Subscription), without the need to override it using generics each time. If you wish to use an external type and import it from another file, you can use add plugin and add the required import statement, or you can use both module#type or module#namespace#type syntax.

directiveContextTypes string[]
mapperTypeSuffix string

Adds a suffix to the imported names to prevent name clashes.

mappers Record<string, string>

Replaces a GraphQL type usage with a custom type, allowing you to return custom object from your resolvers. You can use both module#type and module#namespace#type syntax.

defaultMapper string

Allow you to set the default mapper when it's not being override by mappers or generics. You can specify a type name, or specify a string in module#type or module#namespace#type format. The default value of mappers is the TypeScript type generated by typescript package.

avoidOptionals AvoidOptionalsConfig_1 | boolean

This will cause the generator to avoid using optionals (?), so all field resolvers must be implemented in order to avoid compilation errors. Default value: "false"

showUnusedMappers boolean

Warns about unused mappers. Default value: "true"

enumValues object | string

A raw configuration for enumValues map - can be represented with a single string value for a file path, a map between enum name and a file path, or a map between enum name and an object with explicit enum values.

resolverTypeWrapperSignature string

Allow you to override resolverTypeWrapper definition. Default value: "Promise | T"

federation boolean

Supports Apollo Federation Default value: "false"

enumPrefix boolean

Allow you to disable prefixing for generated enums, works in combination with typesPrefix. Default value: "true"

optionalResolveType boolean

Sets the __resolveType field as optional field. Default value: "false"

immutableTypes boolean

Generates immutable types by adding readonly to properties and uses ReadonlyArray. Default value: "false"

namespacedImportName string

Prefixes all GraphQL related generated types with that value, as namespaces import. You can use this feature to allow separation of plugins to different files. Default value: "''"

resolverTypeSuffix string

Suffix we add to each generated type resolver. Default value: "Resolvers"

allResolversTypeName string

The type name to use when exporting all resolvers signature as unified type. Default value: "Resolvers"

internalResolversPrefix string

Defines the prefix value used for __resolveType and __isTypeOf resolvers. If you are using mercurius-js, please set this field to empty string for better compatibility. Default value: "'__'"

onlyResolveTypeForInterfaces boolean

Turning this flag to true will generate resolver signature that has only resolveType for interfaces, forcing developers to write inherited type resolvers in the type itself. Default value: "false"

strictScalars boolean

Makes scalars strict.

If scalars are found in the schema that are not defined in scalars an error will be thrown during codegen. Default value: "false"

defaultScalarType string

Allows you to override the type that unknown scalars will have. Default value: "any"

scalars object | string

Scalars map or a string, a map between the GraphQL scalar name and the identifier that should be used

namingConvention NamingConventionFn_2 | NamingConventionMap_2 | string
typesPrefix string

Prefixes all the generated types. Default value: ""

typesSuffix string

Suffixes all the generated types. Default value: ""

skipTypename boolean

Does not add __typename to the generated types, unless it was specified in the selection set. Default value: "false"

nonOptionalTypename boolean

Automatically adds __typename field to the generated types, even when they are not specified in the selection set, and makes it non-optional Default value: "false"

useTypeImports boolean

Will use import type {} rather than import {} when importing only types. This gives compatibility with TypeScript's "importsNotUsedAsValues": "error" option Default value: "false"

dedupeFragments boolean

Removes fragment duplicates for reducing data transfer. It is done by removing sub-fragments imports from fragment definition Instead - all of them are imported to the Operation node. Default value: "false"

inlineFragmentTypes string

Whether fragment types should be inlined into other operations. "inline" is the default behavior and will perform deep inlining fragment types within operation type definitions. "combine" is the previous behavior that uses fragment type references without inlining the types (and might cause issues with deeply nested fragment that uses list types). Default value: "inline"

emitLegacyCommonJSImports boolean

Emit legacy common js imports. Default it will be true this way it ensure that generated code works with non-compliant bundlers. Default value: "true"

FlowDocumentsPluginConfig object

This plugin generates Flow types based on your GraphQLSchema and your GraphQL operations and fragments.

It generates types for your GraphQL documents: Query, Mutation, Subscription and Fragment.

This plugin requires you to use @graphql-codegen/flow as well, because it depends on its types.

useFlowExactObjects boolean

Generates Flow types as Exact types. Default value: "true"

useFlowReadOnlyTypes boolean

Generates read-only Flow types Default value: "false"

flattenGeneratedTypes boolean

Flatten fragment spread and inline fragments into a simple selection set before generating. Default value: "false"

preResolveTypes boolean

Uses primitive types where possible. Set to false in order to use Pick and take use the types generated by typescript plugin. Default value: "true"

skipTypeNameForRoot boolean

Avoid adding __typename for root types. This is ignored when a selection explicitly specifies __typename. Default value: "false"

globalNamespace boolean

Puts all generated code under global namespace. Useful for Stencil integration. Default value: "false"

operationResultSuffix string

Adds a suffix to generated operation result type names Default value: ""

dedupeOperationSuffix boolean

Set this configuration to true if you wish to make sure to remove duplicate operation name suffix. Default value: "false"

omitOperationSuffix boolean

Set this configuration to true if you wish to disable auto add suffix of operation name, like Query, Mutation, Subscription, Fragment. Default value: "false"

exportFragmentSpreadSubTypes boolean

If set to true, it will export the sub-types created in order to make it easier to access fields declared under fragment spread. Default value: "false"

experimentalFragmentVariables boolean

If set to true, it will enable support for parsing variables on fragments. Default value: "false"

mergeFragmentTypes boolean

If set to true, merge equal fragment interfaces. Default value: "false"

addUnderscoreToArgsType boolean

Adds _ to generated Args types in order to avoid duplicate identifiers.

enumValues object | string

A raw configuration for enumValues map - can be represented with a single string value for a file path, a map between enum name and a file path, or a map between enum name and an object with explicit enum values.

declarationKind DeclarationKindConfig_1 | string

Overrides the default output for various GraphQL elements.

enumPrefix boolean

Allow you to disable prefixing for generated enums, works in combination with typesPrefix. Default value: "true"

fieldWrapperValue string

Allow you to add wrapper for field type, use T as the generic value. Make sure to set wrapFieldDefinitions to true in order to make this flag work. Default value: "T"

wrapFieldDefinitions boolean

Set to true in order to wrap field definitions with FieldWrapper. This is useful to allow return types such as Promises and functions. Default value: "false"

onlyEnums boolean

This will cause the generator to emit types for enums only Default value: "false"

onlyOperationTypes boolean

This will cause the generator to emit types for operations only (basically only enums and scalars) Default value: "false"

ignoreEnumValuesFromSchema boolean

This will cause the generator to ignore enum values defined in GraphQLSchema Default value: "false"

wrapEntireFieldDefinitions boolean

Set to true in order to wrap field definitions with EntireFieldWrapper. This is useful to allow return types such as Promises and functions for fields. Differs from wrapFieldDefinitions in that this wraps the entire field definition if i.e. the field is an Array, while wrapFieldDefinitions will wrap every single value inside the array. Default value: "true"

entireFieldWrapperValue string

Allow to override the type value of EntireFieldWrapper. This wrapper applies outside of Array and Maybe unlike fieldWrapperValue, that will wrap the inner type. Default value: "T | Promise | (() => T | Promise)"

directiveArgumentAndInputFieldMappings __type_17
directiveArgumentAndInputFieldMappingTypeSuffix string

Adds a suffix to the imported names to prevent name clashes.

strictScalars boolean

Makes scalars strict.

If scalars are found in the schema that are not defined in scalars an error will be thrown during codegen. Default value: "false"

defaultScalarType string

Allows you to override the type that unknown scalars will have. Default value: "any"

scalars object | string

Scalars map or a string, a map between the GraphQL scalar name and the identifier that should be used

namingConvention NamingConventionFn_2 | NamingConventionMap_2 | string
typesPrefix string

Prefixes all the generated types. Default value: ""

typesSuffix string

Suffixes all the generated types. Default value: ""

skipTypename boolean

Does not add __typename to the generated types, unless it was specified in the selection set. Default value: "false"

nonOptionalTypename boolean

Automatically adds __typename field to the generated types, even when they are not specified in the selection set, and makes it non-optional Default value: "false"

useTypeImports boolean

Will use import type {} rather than import {} when importing only types. This gives compatibility with TypeScript's "importsNotUsedAsValues": "error" option Default value: "false"

dedupeFragments boolean

Removes fragment duplicates for reducing data transfer. It is done by removing sub-fragments imports from fragment definition Instead - all of them are imported to the Operation node. Default value: "false"

inlineFragmentTypes string

Whether fragment types should be inlined into other operations. "inline" is the default behavior and will perform deep inlining fragment types within operation type definitions. "combine" is the previous behavior that uses fragment type references without inlining the types (and might cause issues with deeply nested fragment that uses list types). Default value: "inline"

emitLegacyCommonJSImports boolean

Emit legacy common js imports. Default it will be true this way it ensure that generated code works with non-compliant bundlers. Default value: "true"

IntrospectionPluginConfig object

This plugin generates a GraphQL introspection file based on your GraphQL schema.

minify boolean

Set to true in order to minify the JSON output. Default value: "false"

descriptions boolean

Whether to include descriptions in the introspection result. Default value: "true"

specifiedByUrl boolean

Whether to include specifiedByUrl in the introspection result. Default value: "false"

directiveIsRepeatable boolean

Whether to include isRepeatable flag on directives. Default value: "true"

schemaDescription boolean

Whether to include description field on schema. Default value: "false"

federation boolean
FragmentMatcherConfig object

This plugin generates an introspection file but only with Interfaces and Unions, based on your GraphQLSchema.

If you are using apollo-client and your schema contains interface or union declaration, it's recommended to use Apollo's Fragment Matcher and the result generated by the plugin.

You can read more about it in apollo-client documentation.

Fragment Matcher plugin accepts a TypeScript / JavaScript or a JSON file as an output (.ts, .tsx, .js, .jsx, .json).

Both in TypeScript and JavaScript a default export is being used.

The output is based on the output you choose for the output file name.

module string

Compatible only with JSON extension, allow you to choose the export type, either module.exports or export default. Allowed values are: commonjs, es2015. Default value: "es2015"

Values: "commonjs" "es2015"
apolloClientVersion number

Compatible only with TS/TSX/JS/JSX extensions, allow you to generate output based on your Apollo Client version. Note: 3 also works for version 4. Default value: "3"

Values: 2 3
useExplicitTyping boolean

Create an explicit type based on your schema. This can help IDEs autofill your fragment matcher. This is mostly useful if you do more with your fragment matcher than just pass it to an Apollo-Client. Default value: "false"

federation boolean
deterministic boolean

When enabled sorts the fragment types lexicographically. This is useful for deterministic output. Default value: "false"

UrqlIntrospectionConfig object

This plugin generates an introspection file for Schema Awareness feature of Urql Cache Exchange

You can read more about it in urql documentation: https://formidable.com/open-source/urql/docs/graphcache/schema-awareness.

Urql Introspection plugin accepts a TypeScript / JavaScript or a JSON file as an output (.ts, .tsx, .js, .jsx, .json).

Both in TypeScript and JavaScript a default export is being used.

The output is based on the output you choose for the output file name.

module string

Compatible only with JSON extension, allow you to choose the export type, either module.exports or export default. Allowed values are: commonjs, es2015. Default value: "es2015"

Values: "commonjs" "es2015"
useTypeImports boolean

Will use import type {} rather than import {} when importing only types. This gives compatibility with TypeScript's "importsNotUsedAsValues": "error" option Default value: "false"

includeScalars boolean

Includes scalar names (instead of an Any replacement) in the output when enabled. Default value: "false"

includeEnums boolean

Includes enums (instead of an Any replacement) in the output when enabled. Default value: "false"

includeInputs boolean

Includes all input objects (instead of an Any replacement) in the output when enabled. Default value: "false"

includeDirectives boolean

Includes all directives in the output when enabled. Default value: "false"

HasuraAllowListPluginConfig object
collectionName string

Choose the collection name to be generated. Defaults to allowed-queries Default value: "allowed-queries"

configVersion number

Target metadata config version. Supported versions are 2 and 3. This is mostly for future proofing, currently has no impact as both versions use the same format. The default value will change in the future if/when newer config versions are released. Default value: "3"

Values: 2 3
globalFragments boolean

Whether to source fragments per-document, or globally. If set, will enforce fragment name uniqueness Default value: "false"

fragmentsOrder string

Whether to order fragments by global definition order, or by definition order in the document Default value: "definition"

Values: "document" "global"
ModulesConfig object
baseTypesPath string

Required, should point to the base schema types file. The key of the output is used a base path for this file.

importBaseTypesFrom string

Overrides the package import for the base types. Use this if you are within a monorepo, and you wish to import the base types directly from a different package, and not from a relative path.

cwd string

Optional, override the cwd of the execution. We are using cwd to figure out the imports between files. Use this if your execution path is not your project root directory. Default value: "process.cwd()"

importTypesNamespace string

Optional, override the name of the import namespace used to import from the baseTypesPath file. Default value: "Types"

filename string

Required, sets the file name for the generated files.

encapsulateModuleTypes string

Configure how to encapsulate the module types, to avoid confusion.

namespace (default): will wrap all types in a TypeScript namespace, using the module name. prefix: will prefix all types from a specific module with the module name. none: will skip encapsulation, and generate type as-is. Default value: "namespace"

requireRootResolvers boolean

Generate resolvers of root types (Query, Mutation and Subscription) as non-optional. Default value: "false"

useGraphQLModules boolean

By default, the generated types will generate some code specific to graphql-modules library.

If you are not using GraphQL-Modules, you can disable this feature by setting this to false. Default value: "true"

NearOperationFileConfig object
baseTypesPath string

points to the base schema types file. The key of the output is used a the base path for this file.

If you wish to use an NPM package or a local workspace package, make sure to prefix the package name with ~.

importAllFragmentsFrom FragmentImportFromFn | string

Overrides all external fragments import types by using a specific file path or a package name.

If you wish to use an NPM package or a local workspace package, make sure to prefix the package name with ~.

fileName string

Optional, sets a specific file name for the generated files. Use this to override the generated file name when generating files for example based on multiple .graphql files in separate directories.

extension string

Optional, sets the extension for the generated files. Use this to override the extension if you are using plugins that requires a different type of extensions (such as typescript-react-apollo) Default value: ".generated.ts"

cwd string

Optional, override the cwd of the execution. We are using cwd to figure out the imports between files. Use this if your execution path is not your project root directory. Default value: "process.cwd()"

folder string

Optional, defines a folder, (Relative to the source files) where the generated files will be created. Default value: "''"

importTypesNamespace string

Optional, override the name of the import namespace used to import from the baseTypesPath file. Default value: "Types"

ImportTypesConfig object
typesPath string

Required, should point to the base schema types file. The key of the output is used a the base path for this file.

importTypesNamespace string

Optional, override the name of the import namespace used to import from the baseTypesPath file. Default value: "Types"

Types.InstanceOrArray GraphQLSchema | Types.SchemaWithLoader | Types.SchemaFromCodeFile | Types.UrlSchemaWithOptions | Types.LocalSchemaPathWithOptions | Types.ApolloEngineSchemaOptions | Types.GitHubSchemaOptions | Types.Schema[] | string
GraphQLSchema object

Schema Definition

A Schema is created by supplying the root types of each type of operation, query and mutation (optional). A schema definition is then supplied to the validator and executor.

Example:

const MyAppSchema = new GraphQLSchema({
  query: MyAppQueryRootType,
  mutation: MyAppMutationRootType,
})

Note: When the schema is constructed, by default only the types that are reachable by traversing the root types are included, other types must be explicitly referenced.

Example:

const characterInterface = new GraphQLInterfaceType({
  name: 'Character',
  ...
});

const humanType = new GraphQLObjectType({
  name: 'Human',
  interfaces: [characterInterface],
  ...
});

const droidType = new GraphQLObjectType({
  name: 'Droid',
  interfaces: [characterInterface],
  ...
});

const schema = new GraphQLSchema({
  query: new GraphQLObjectType({
    name: 'Query',
    fields: {
      hero: { type: characterInterface, ... },
    }
  }),
  ...
  // Since this schema references only the `Character` interface it's
  // necessary to explicitly list the types that implement it if
  // you want them to be included in the final schema.
  types: [humanType, droidType],
})

Note: If an array of directives are provided to GraphQLSchema, that will be the exact list of directives represented and allowed. If directives is not provided then a default set of the specified directives (e.g. @include and @skip) will be used. If you wish to provide additional directives to these specified directives, you must explicitly declare them. Example:

const MyAppSchema = new GraphQLSchema({
  ...
  directives: specifiedDirectives.concat([ myCustomDirective ]),
})
description string

Conveniently represents flow's "Maybe" type https://flow.org/en/docs/types/maybe/

extensions Record<string, any>

Custom extensions

extensionASTNodes SchemaExtensionNode[]
__validationErrors ReadonlyArray_6
_queryType
_mutationType
_subscriptionType
_directives
_typeMap
_subTypeMap
_implementationsMap
__@toStringTag@38 string
Maybe string

Conveniently represents flow's "Maybe" type https://flow.org/en/docs/types/maybe/

GraphQLSchemaExtensions Record<string, any>

Custom extensions

SchemaDefinitionNode object
kind string

Type System Definitions

Values: "SchemaDefinition"
loc object

Contains a range of UTF-8 character offsets and token references that identify the region of the source from which the AST derived.

6 nested properties
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

startToken object

Represents a range of characters represented by a lexical token within a Source.

9 nested properties
kind string

An exported enum describing the different kinds of tokens that the lexer emits.

Values: "!" "$" "&" "(" ")" "..." ":" "<EOF>" "<SOF>" "=" "@" "BlockString" "Comment" "Float" "Int" "Name" "String" "[" "]" "{" "|" "}"
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

line number

The 1-indexed line number on which this Token appears.

column number

The 1-indexed column number at which this Token begins.

value string

For non-punctuation tokens, represents the interpreted value of the token.

Note: is undefined for punctuation tokens, but typed as string for convenience in the parser.

prev object

Represents a range of characters represented by a lexical token within a Source.

next object

Represents a range of characters represented by a lexical token within a Source.

__@toStringTag@38 string
endToken object

Represents a range of characters represented by a lexical token within a Source.

9 nested properties
kind string

An exported enum describing the different kinds of tokens that the lexer emits.

Values: "!" "$" "&" "(" ")" "..." ":" "<EOF>" "<SOF>" "=" "@" "BlockString" "Comment" "Float" "Int" "Name" "String" "[" "]" "{" "|" "}"
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

line number

The 1-indexed line number on which this Token appears.

column number

The 1-indexed column number at which this Token begins.

value string

For non-punctuation tokens, represents the interpreted value of the token.

Note: is undefined for punctuation tokens, but typed as string for convenience in the parser.

prev object

Represents a range of characters represented by a lexical token within a Source.

next object

Represents a range of characters represented by a lexical token within a Source.

__@toStringTag@38 string
source object

A representation of source input to GraphQL. The name and locationOffset parameters are optional, but they are useful for clients who store GraphQL documents in source files. For example, if the GraphQL input starts at line 40 in a file named Foo.graphql, it might be useful for name to be "Foo.graphql" and location to be { line: 40, column: 1 }. The line and column properties in locationOffset are 1-indexed.

4 nested properties
body string
name string
locationOffset object
__@toStringTag@38 string
__@toStringTag@38 string
description object
4 nested properties
kind string
Values: "StringValue"
loc object

Contains a range of UTF-8 character offsets and token references that identify the region of the source from which the AST derived.

6 nested properties
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

startToken object

Represents a range of characters represented by a lexical token within a Source.

endToken object

Represents a range of characters represented by a lexical token within a Source.

source object

A representation of source input to GraphQL. The name and locationOffset parameters are optional, but they are useful for clients who store GraphQL documents in source files. For example, if the GraphQL input starts at line 40 in a file named Foo.graphql, it might be useful for name to be "Foo.graphql" and location to be { line: 40, column: 1 }. The line and column properties in locationOffset are 1-indexed.

__@toStringTag@38 string
value string
block boolean
Kind.SCHEMA_DEFINITION string

Type System Definitions

Location object

Contains a range of UTF-8 character offsets and token references that identify the region of the source from which the AST derived.

start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

startToken object

Represents a range of characters represented by a lexical token within a Source.

9 nested properties
kind string

An exported enum describing the different kinds of tokens that the lexer emits.

Values: "!" "$" "&" "(" ")" "..." ":" "<EOF>" "<SOF>" "=" "@" "BlockString" "Comment" "Float" "Int" "Name" "String" "[" "]" "{" "|" "}"
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

line number

The 1-indexed line number on which this Token appears.

column number

The 1-indexed column number at which this Token begins.

value string

For non-punctuation tokens, represents the interpreted value of the token.

Note: is undefined for punctuation tokens, but typed as string for convenience in the parser.

prev object

Represents a range of characters represented by a lexical token within a Source.

9 nested properties
kind string

An exported enum describing the different kinds of tokens that the lexer emits.

Values: "!" "$" "&" "(" ")" "..." ":" "<EOF>" "<SOF>" "=" "@" "BlockString" "Comment" "Float" "Int" "Name" "String" "[" "]" "{" "|" "}"
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

line number

The 1-indexed line number on which this Token appears.

column number

The 1-indexed column number at which this Token begins.

value string

For non-punctuation tokens, represents the interpreted value of the token.

Note: is undefined for punctuation tokens, but typed as string for convenience in the parser.

prev object

Represents a range of characters represented by a lexical token within a Source.

next object

Represents a range of characters represented by a lexical token within a Source.

__@toStringTag@38 string
next object

Represents a range of characters represented by a lexical token within a Source.

9 nested properties
kind string

An exported enum describing the different kinds of tokens that the lexer emits.

Values: "!" "$" "&" "(" ")" "..." ":" "<EOF>" "<SOF>" "=" "@" "BlockString" "Comment" "Float" "Int" "Name" "String" "[" "]" "{" "|" "}"
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

line number

The 1-indexed line number on which this Token appears.

column number

The 1-indexed column number at which this Token begins.

value string

For non-punctuation tokens, represents the interpreted value of the token.

Note: is undefined for punctuation tokens, but typed as string for convenience in the parser.

prev object

Represents a range of characters represented by a lexical token within a Source.

next object

Represents a range of characters represented by a lexical token within a Source.

__@toStringTag@38 string
__@toStringTag@38 string
endToken object

Represents a range of characters represented by a lexical token within a Source.

9 nested properties
kind string

An exported enum describing the different kinds of tokens that the lexer emits.

Values: "!" "$" "&" "(" ")" "..." ":" "<EOF>" "<SOF>" "=" "@" "BlockString" "Comment" "Float" "Int" "Name" "String" "[" "]" "{" "|" "}"
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

line number

The 1-indexed line number on which this Token appears.

column number

The 1-indexed column number at which this Token begins.

value string

For non-punctuation tokens, represents the interpreted value of the token.

Note: is undefined for punctuation tokens, but typed as string for convenience in the parser.

prev object

Represents a range of characters represented by a lexical token within a Source.

9 nested properties
kind string

An exported enum describing the different kinds of tokens that the lexer emits.

Values: "!" "$" "&" "(" ")" "..." ":" "<EOF>" "<SOF>" "=" "@" "BlockString" "Comment" "Float" "Int" "Name" "String" "[" "]" "{" "|" "}"
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

line number

The 1-indexed line number on which this Token appears.

column number

The 1-indexed column number at which this Token begins.

value string

For non-punctuation tokens, represents the interpreted value of the token.

Note: is undefined for punctuation tokens, but typed as string for convenience in the parser.

prev object

Represents a range of characters represented by a lexical token within a Source.

next object

Represents a range of characters represented by a lexical token within a Source.

__@toStringTag@38 string
next object

Represents a range of characters represented by a lexical token within a Source.

9 nested properties
kind string

An exported enum describing the different kinds of tokens that the lexer emits.

Values: "!" "$" "&" "(" ")" "..." ":" "<EOF>" "<SOF>" "=" "@" "BlockString" "Comment" "Float" "Int" "Name" "String" "[" "]" "{" "|" "}"
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

line number

The 1-indexed line number on which this Token appears.

column number

The 1-indexed column number at which this Token begins.

value string

For non-punctuation tokens, represents the interpreted value of the token.

Note: is undefined for punctuation tokens, but typed as string for convenience in the parser.

prev object

Represents a range of characters represented by a lexical token within a Source.

next object

Represents a range of characters represented by a lexical token within a Source.

__@toStringTag@38 string
__@toStringTag@38 string
source object

A representation of source input to GraphQL. The name and locationOffset parameters are optional, but they are useful for clients who store GraphQL documents in source files. For example, if the GraphQL input starts at line 40 in a file named Foo.graphql, it might be useful for name to be "Foo.graphql" and location to be { line: 40, column: 1 }. The line and column properties in locationOffset are 1-indexed.

4 nested properties
body string
name string
locationOffset object
2 nested properties
line number
column number
__@toStringTag@38 string
__@toStringTag@38 string
Token object

Represents a range of characters represented by a lexical token within a Source.

kind string

An exported enum describing the different kinds of tokens that the lexer emits.

Values: "!" "$" "&" "(" ")" "..." ":" "<EOF>" "<SOF>" "=" "@" "BlockString" "Comment" "Float" "Int" "Name" "String" "[" "]" "{" "|" "}"
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

line number

The 1-indexed line number on which this Token appears.

column number

The 1-indexed column number at which this Token begins.

value string

For non-punctuation tokens, represents the interpreted value of the token.

Note: is undefined for punctuation tokens, but typed as string for convenience in the parser.

prev object

Represents a range of characters represented by a lexical token within a Source.

9 nested properties
kind string

An exported enum describing the different kinds of tokens that the lexer emits.

Values: "!" "$" "&" "(" ")" "..." ":" "<EOF>" "<SOF>" "=" "@" "BlockString" "Comment" "Float" "Int" "Name" "String" "[" "]" "{" "|" "}"
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

line number

The 1-indexed line number on which this Token appears.

column number

The 1-indexed column number at which this Token begins.

value string

For non-punctuation tokens, represents the interpreted value of the token.

Note: is undefined for punctuation tokens, but typed as string for convenience in the parser.

prev object

Represents a range of characters represented by a lexical token within a Source.

9 nested properties
kind string

An exported enum describing the different kinds of tokens that the lexer emits.

Values: "!" "$" "&" "(" ")" "..." ":" "<EOF>" "<SOF>" "=" "@" "BlockString" "Comment" "Float" "Int" "Name" "String" "[" "]" "{" "|" "}"
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

line number

The 1-indexed line number on which this Token appears.

column number

The 1-indexed column number at which this Token begins.

value string

For non-punctuation tokens, represents the interpreted value of the token.

Note: is undefined for punctuation tokens, but typed as string for convenience in the parser.

prev object

Represents a range of characters represented by a lexical token within a Source.

next object

Represents a range of characters represented by a lexical token within a Source.

__@toStringTag@38 string
next object

Represents a range of characters represented by a lexical token within a Source.

9 nested properties
kind string

An exported enum describing the different kinds of tokens that the lexer emits.

Values: "!" "$" "&" "(" ")" "..." ":" "<EOF>" "<SOF>" "=" "@" "BlockString" "Comment" "Float" "Int" "Name" "String" "[" "]" "{" "|" "}"
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

line number

The 1-indexed line number on which this Token appears.

column number

The 1-indexed column number at which this Token begins.

value string

For non-punctuation tokens, represents the interpreted value of the token.

Note: is undefined for punctuation tokens, but typed as string for convenience in the parser.

prev object

Represents a range of characters represented by a lexical token within a Source.

next object

Represents a range of characters represented by a lexical token within a Source.

__@toStringTag@38 string
__@toStringTag@38 string
next object

Represents a range of characters represented by a lexical token within a Source.

9 nested properties
kind string

An exported enum describing the different kinds of tokens that the lexer emits.

Values: "!" "$" "&" "(" ")" "..." ":" "<EOF>" "<SOF>" "=" "@" "BlockString" "Comment" "Float" "Int" "Name" "String" "[" "]" "{" "|" "}"
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

line number

The 1-indexed line number on which this Token appears.

column number

The 1-indexed column number at which this Token begins.

value string

For non-punctuation tokens, represents the interpreted value of the token.

Note: is undefined for punctuation tokens, but typed as string for convenience in the parser.

prev object

Represents a range of characters represented by a lexical token within a Source.

9 nested properties
kind string

An exported enum describing the different kinds of tokens that the lexer emits.

Values: "!" "$" "&" "(" ")" "..." ":" "<EOF>" "<SOF>" "=" "@" "BlockString" "Comment" "Float" "Int" "Name" "String" "[" "]" "{" "|" "}"
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

line number

The 1-indexed line number on which this Token appears.

column number

The 1-indexed column number at which this Token begins.

value string

For non-punctuation tokens, represents the interpreted value of the token.

Note: is undefined for punctuation tokens, but typed as string for convenience in the parser.

prev object

Represents a range of characters represented by a lexical token within a Source.

next object

Represents a range of characters represented by a lexical token within a Source.

__@toStringTag@38 string
next object

Represents a range of characters represented by a lexical token within a Source.

9 nested properties
kind string

An exported enum describing the different kinds of tokens that the lexer emits.

Values: "!" "$" "&" "(" ")" "..." ":" "<EOF>" "<SOF>" "=" "@" "BlockString" "Comment" "Float" "Int" "Name" "String" "[" "]" "{" "|" "}"
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

line number

The 1-indexed line number on which this Token appears.

column number

The 1-indexed column number at which this Token begins.

value string

For non-punctuation tokens, represents the interpreted value of the token.

Note: is undefined for punctuation tokens, but typed as string for convenience in the parser.

prev object

Represents a range of characters represented by a lexical token within a Source.

next object

Represents a range of characters represented by a lexical token within a Source.

__@toStringTag@38 string
__@toStringTag@38 string
__@toStringTag@38 string
TokenKind string

An exported enum describing the different kinds of tokens that the lexer emits.

Source object

A representation of source input to GraphQL. The name and locationOffset parameters are optional, but they are useful for clients who store GraphQL documents in source files. For example, if the GraphQL input starts at line 40 in a file named Foo.graphql, it might be useful for name to be "Foo.graphql" and location to be { line: 40, column: 1 }. The line and column properties in locationOffset are 1-indexed.

body string
name string
locationOffset object
2 nested properties
line number
column number
__@toStringTag@38 string
Location_1 object
line number
column number
StringValueNode object
kind string
Values: "StringValue"
loc object

Contains a range of UTF-8 character offsets and token references that identify the region of the source from which the AST derived.

6 nested properties
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

startToken object

Represents a range of characters represented by a lexical token within a Source.

9 nested properties
kind string

An exported enum describing the different kinds of tokens that the lexer emits.

Values: "!" "$" "&" "(" ")" "..." ":" "<EOF>" "<SOF>" "=" "@" "BlockString" "Comment" "Float" "Int" "Name" "String" "[" "]" "{" "|" "}"
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

line number

The 1-indexed line number on which this Token appears.

column number

The 1-indexed column number at which this Token begins.

value string

For non-punctuation tokens, represents the interpreted value of the token.

Note: is undefined for punctuation tokens, but typed as string for convenience in the parser.

prev object

Represents a range of characters represented by a lexical token within a Source.

next object

Represents a range of characters represented by a lexical token within a Source.

__@toStringTag@38 string
endToken object

Represents a range of characters represented by a lexical token within a Source.

9 nested properties
kind string

An exported enum describing the different kinds of tokens that the lexer emits.

Values: "!" "$" "&" "(" ")" "..." ":" "<EOF>" "<SOF>" "=" "@" "BlockString" "Comment" "Float" "Int" "Name" "String" "[" "]" "{" "|" "}"
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

line number

The 1-indexed line number on which this Token appears.

column number

The 1-indexed column number at which this Token begins.

value string

For non-punctuation tokens, represents the interpreted value of the token.

Note: is undefined for punctuation tokens, but typed as string for convenience in the parser.

prev object

Represents a range of characters represented by a lexical token within a Source.

next object

Represents a range of characters represented by a lexical token within a Source.

__@toStringTag@38 string
source object

A representation of source input to GraphQL. The name and locationOffset parameters are optional, but they are useful for clients who store GraphQL documents in source files. For example, if the GraphQL input starts at line 40 in a file named Foo.graphql, it might be useful for name to be "Foo.graphql" and location to be { line: 40, column: 1 }. The line and column properties in locationOffset are 1-indexed.

4 nested properties
body string
name string
locationOffset object
__@toStringTag@38 string
__@toStringTag@38 string
value string
block boolean
Kind.STRING string
ReadonlyArray ConstDirectiveNode[]
ConstDirectiveNode object
kind string

Directives

Values: "Directive"
loc object

Contains a range of UTF-8 character offsets and token references that identify the region of the source from which the AST derived.

6 nested properties
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

startToken object

Represents a range of characters represented by a lexical token within a Source.

9 nested properties
kind string

An exported enum describing the different kinds of tokens that the lexer emits.

Values: "!" "$" "&" "(" ")" "..." ":" "<EOF>" "<SOF>" "=" "@" "BlockString" "Comment" "Float" "Int" "Name" "String" "[" "]" "{" "|" "}"
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

line number

The 1-indexed line number on which this Token appears.

column number

The 1-indexed column number at which this Token begins.

value string

For non-punctuation tokens, represents the interpreted value of the token.

Note: is undefined for punctuation tokens, but typed as string for convenience in the parser.

prev object

Represents a range of characters represented by a lexical token within a Source.

next object

Represents a range of characters represented by a lexical token within a Source.

__@toStringTag@38 string
endToken object

Represents a range of characters represented by a lexical token within a Source.

9 nested properties
kind string

An exported enum describing the different kinds of tokens that the lexer emits.

Values: "!" "$" "&" "(" ")" "..." ":" "<EOF>" "<SOF>" "=" "@" "BlockString" "Comment" "Float" "Int" "Name" "String" "[" "]" "{" "|" "}"
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

line number

The 1-indexed line number on which this Token appears.

column number

The 1-indexed column number at which this Token begins.

value string

For non-punctuation tokens, represents the interpreted value of the token.

Note: is undefined for punctuation tokens, but typed as string for convenience in the parser.

prev object

Represents a range of characters represented by a lexical token within a Source.

next object

Represents a range of characters represented by a lexical token within a Source.

__@toStringTag@38 string
source object

A representation of source input to GraphQL. The name and locationOffset parameters are optional, but they are useful for clients who store GraphQL documents in source files. For example, if the GraphQL input starts at line 40 in a file named Foo.graphql, it might be useful for name to be "Foo.graphql" and location to be { line: 40, column: 1 }. The line and column properties in locationOffset are 1-indexed.

4 nested properties
body string
name string
locationOffset object
__@toStringTag@38 string
__@toStringTag@38 string
name object

Name

3 nested properties
kind string

Name

Values: "Name"
loc object

Contains a range of UTF-8 character offsets and token references that identify the region of the source from which the AST derived.

6 nested properties
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

startToken object

Represents a range of characters represented by a lexical token within a Source.

endToken object

Represents a range of characters represented by a lexical token within a Source.

source object

A representation of source input to GraphQL. The name and locationOffset parameters are optional, but they are useful for clients who store GraphQL documents in source files. For example, if the GraphQL input starts at line 40 in a file named Foo.graphql, it might be useful for name to be "Foo.graphql" and location to be { line: 40, column: 1 }. The line and column properties in locationOffset are 1-indexed.

__@toStringTag@38 string
value string
Kind.DIRECTIVE string

Directives

NameNode object

Name

kind string

Name

Values: "Name"
loc object

Contains a range of UTF-8 character offsets and token references that identify the region of the source from which the AST derived.

6 nested properties
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

startToken object

Represents a range of characters represented by a lexical token within a Source.

9 nested properties
kind string

An exported enum describing the different kinds of tokens that the lexer emits.

Values: "!" "$" "&" "(" ")" "..." ":" "<EOF>" "<SOF>" "=" "@" "BlockString" "Comment" "Float" "Int" "Name" "String" "[" "]" "{" "|" "}"
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

line number

The 1-indexed line number on which this Token appears.

column number

The 1-indexed column number at which this Token begins.

value string

For non-punctuation tokens, represents the interpreted value of the token.

Note: is undefined for punctuation tokens, but typed as string for convenience in the parser.

prev object

Represents a range of characters represented by a lexical token within a Source.

next object

Represents a range of characters represented by a lexical token within a Source.

__@toStringTag@38 string
endToken object

Represents a range of characters represented by a lexical token within a Source.

9 nested properties
kind string

An exported enum describing the different kinds of tokens that the lexer emits.

Values: "!" "$" "&" "(" ")" "..." ":" "<EOF>" "<SOF>" "=" "@" "BlockString" "Comment" "Float" "Int" "Name" "String" "[" "]" "{" "|" "}"
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

line number

The 1-indexed line number on which this Token appears.

column number

The 1-indexed column number at which this Token begins.

value string

For non-punctuation tokens, represents the interpreted value of the token.

Note: is undefined for punctuation tokens, but typed as string for convenience in the parser.

prev object

Represents a range of characters represented by a lexical token within a Source.

next object

Represents a range of characters represented by a lexical token within a Source.

__@toStringTag@38 string
source object

A representation of source input to GraphQL. The name and locationOffset parameters are optional, but they are useful for clients who store GraphQL documents in source files. For example, if the GraphQL input starts at line 40 in a file named Foo.graphql, it might be useful for name to be "Foo.graphql" and location to be { line: 40, column: 1 }. The line and column properties in locationOffset are 1-indexed.

4 nested properties
body string
name string
locationOffset object
__@toStringTag@38 string
__@toStringTag@38 string
value string
Kind.NAME string

Name

ReadonlyArray_1 ConstArgumentNode[]
ConstArgumentNode object
kind string
Values: "Argument"
loc object

Contains a range of UTF-8 character offsets and token references that identify the region of the source from which the AST derived.

6 nested properties
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

startToken object

Represents a range of characters represented by a lexical token within a Source.

9 nested properties
kind string

An exported enum describing the different kinds of tokens that the lexer emits.

Values: "!" "$" "&" "(" ")" "..." ":" "<EOF>" "<SOF>" "=" "@" "BlockString" "Comment" "Float" "Int" "Name" "String" "[" "]" "{" "|" "}"
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

line number

The 1-indexed line number on which this Token appears.

column number

The 1-indexed column number at which this Token begins.

value string

For non-punctuation tokens, represents the interpreted value of the token.

Note: is undefined for punctuation tokens, but typed as string for convenience in the parser.

prev object

Represents a range of characters represented by a lexical token within a Source.

next object

Represents a range of characters represented by a lexical token within a Source.

__@toStringTag@38 string
endToken object

Represents a range of characters represented by a lexical token within a Source.

9 nested properties
kind string

An exported enum describing the different kinds of tokens that the lexer emits.

Values: "!" "$" "&" "(" ")" "..." ":" "<EOF>" "<SOF>" "=" "@" "BlockString" "Comment" "Float" "Int" "Name" "String" "[" "]" "{" "|" "}"
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

line number

The 1-indexed line number on which this Token appears.

column number

The 1-indexed column number at which this Token begins.

value string

For non-punctuation tokens, represents the interpreted value of the token.

Note: is undefined for punctuation tokens, but typed as string for convenience in the parser.

prev object

Represents a range of characters represented by a lexical token within a Source.

next object

Represents a range of characters represented by a lexical token within a Source.

__@toStringTag@38 string
source object

A representation of source input to GraphQL. The name and locationOffset parameters are optional, but they are useful for clients who store GraphQL documents in source files. For example, if the GraphQL input starts at line 40 in a file named Foo.graphql, it might be useful for name to be "Foo.graphql" and location to be { line: 40, column: 1 }. The line and column properties in locationOffset are 1-indexed.

4 nested properties
body string
name string
locationOffset object
__@toStringTag@38 string
__@toStringTag@38 string
name object

Name

3 nested properties
kind string

Name

Values: "Name"
loc object

Contains a range of UTF-8 character offsets and token references that identify the region of the source from which the AST derived.

6 nested properties
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

startToken object

Represents a range of characters represented by a lexical token within a Source.

endToken object

Represents a range of characters represented by a lexical token within a Source.

source object

A representation of source input to GraphQL. The name and locationOffset parameters are optional, but they are useful for clients who store GraphQL documents in source files. For example, if the GraphQL input starts at line 40 in a file named Foo.graphql, it might be useful for name to be "Foo.graphql" and location to be { line: 40, column: 1 }. The line and column properties in locationOffset are 1-indexed.

__@toStringTag@38 string
value string
Kind.ARGUMENT string
ConstValueNode IntValueNode | FloatValueNode | StringValueNode | BooleanValueNode | NullValueNode | EnumValueNode | ConstListValueNode | ConstObjectValueNode
IntValueNode object
kind string
Values: "IntValue"
loc object

Contains a range of UTF-8 character offsets and token references that identify the region of the source from which the AST derived.

6 nested properties
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

startToken object

Represents a range of characters represented by a lexical token within a Source.

9 nested properties
kind string

An exported enum describing the different kinds of tokens that the lexer emits.

Values: "!" "$" "&" "(" ")" "..." ":" "<EOF>" "<SOF>" "=" "@" "BlockString" "Comment" "Float" "Int" "Name" "String" "[" "]" "{" "|" "}"
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

line number

The 1-indexed line number on which this Token appears.

column number

The 1-indexed column number at which this Token begins.

value string

For non-punctuation tokens, represents the interpreted value of the token.

Note: is undefined for punctuation tokens, but typed as string for convenience in the parser.

prev object

Represents a range of characters represented by a lexical token within a Source.

next object

Represents a range of characters represented by a lexical token within a Source.

__@toStringTag@38 string
endToken object

Represents a range of characters represented by a lexical token within a Source.

9 nested properties
kind string

An exported enum describing the different kinds of tokens that the lexer emits.

Values: "!" "$" "&" "(" ")" "..." ":" "<EOF>" "<SOF>" "=" "@" "BlockString" "Comment" "Float" "Int" "Name" "String" "[" "]" "{" "|" "}"
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

line number

The 1-indexed line number on which this Token appears.

column number

The 1-indexed column number at which this Token begins.

value string

For non-punctuation tokens, represents the interpreted value of the token.

Note: is undefined for punctuation tokens, but typed as string for convenience in the parser.

prev object

Represents a range of characters represented by a lexical token within a Source.

next object

Represents a range of characters represented by a lexical token within a Source.

__@toStringTag@38 string
source object

A representation of source input to GraphQL. The name and locationOffset parameters are optional, but they are useful for clients who store GraphQL documents in source files. For example, if the GraphQL input starts at line 40 in a file named Foo.graphql, it might be useful for name to be "Foo.graphql" and location to be { line: 40, column: 1 }. The line and column properties in locationOffset are 1-indexed.

4 nested properties
body string
name string
locationOffset object
__@toStringTag@38 string
__@toStringTag@38 string
value string
Kind.INT string
FloatValueNode object
kind string
Values: "FloatValue"
loc object

Contains a range of UTF-8 character offsets and token references that identify the region of the source from which the AST derived.

6 nested properties
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

startToken object

Represents a range of characters represented by a lexical token within a Source.

9 nested properties
kind string

An exported enum describing the different kinds of tokens that the lexer emits.

Values: "!" "$" "&" "(" ")" "..." ":" "<EOF>" "<SOF>" "=" "@" "BlockString" "Comment" "Float" "Int" "Name" "String" "[" "]" "{" "|" "}"
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

line number

The 1-indexed line number on which this Token appears.

column number

The 1-indexed column number at which this Token begins.

value string

For non-punctuation tokens, represents the interpreted value of the token.

Note: is undefined for punctuation tokens, but typed as string for convenience in the parser.

prev object

Represents a range of characters represented by a lexical token within a Source.

next object

Represents a range of characters represented by a lexical token within a Source.

__@toStringTag@38 string
endToken object

Represents a range of characters represented by a lexical token within a Source.

9 nested properties
kind string

An exported enum describing the different kinds of tokens that the lexer emits.

Values: "!" "$" "&" "(" ")" "..." ":" "<EOF>" "<SOF>" "=" "@" "BlockString" "Comment" "Float" "Int" "Name" "String" "[" "]" "{" "|" "}"
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

line number

The 1-indexed line number on which this Token appears.

column number

The 1-indexed column number at which this Token begins.

value string

For non-punctuation tokens, represents the interpreted value of the token.

Note: is undefined for punctuation tokens, but typed as string for convenience in the parser.

prev object

Represents a range of characters represented by a lexical token within a Source.

next object

Represents a range of characters represented by a lexical token within a Source.

__@toStringTag@38 string
source object

A representation of source input to GraphQL. The name and locationOffset parameters are optional, but they are useful for clients who store GraphQL documents in source files. For example, if the GraphQL input starts at line 40 in a file named Foo.graphql, it might be useful for name to be "Foo.graphql" and location to be { line: 40, column: 1 }. The line and column properties in locationOffset are 1-indexed.

4 nested properties
body string
name string
locationOffset object
__@toStringTag@38 string
__@toStringTag@38 string
value string
Kind.FLOAT string
BooleanValueNode object
kind string
Values: "BooleanValue"
loc object

Contains a range of UTF-8 character offsets and token references that identify the region of the source from which the AST derived.

6 nested properties
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

startToken object

Represents a range of characters represented by a lexical token within a Source.

9 nested properties
kind string

An exported enum describing the different kinds of tokens that the lexer emits.

Values: "!" "$" "&" "(" ")" "..." ":" "<EOF>" "<SOF>" "=" "@" "BlockString" "Comment" "Float" "Int" "Name" "String" "[" "]" "{" "|" "}"
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

line number

The 1-indexed line number on which this Token appears.

column number

The 1-indexed column number at which this Token begins.

value string

For non-punctuation tokens, represents the interpreted value of the token.

Note: is undefined for punctuation tokens, but typed as string for convenience in the parser.

prev object

Represents a range of characters represented by a lexical token within a Source.

next object

Represents a range of characters represented by a lexical token within a Source.

__@toStringTag@38 string
endToken object

Represents a range of characters represented by a lexical token within a Source.

9 nested properties
kind string

An exported enum describing the different kinds of tokens that the lexer emits.

Values: "!" "$" "&" "(" ")" "..." ":" "<EOF>" "<SOF>" "=" "@" "BlockString" "Comment" "Float" "Int" "Name" "String" "[" "]" "{" "|" "}"
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

line number

The 1-indexed line number on which this Token appears.

column number

The 1-indexed column number at which this Token begins.

value string

For non-punctuation tokens, represents the interpreted value of the token.

Note: is undefined for punctuation tokens, but typed as string for convenience in the parser.

prev object

Represents a range of characters represented by a lexical token within a Source.

next object

Represents a range of characters represented by a lexical token within a Source.

__@toStringTag@38 string
source object

A representation of source input to GraphQL. The name and locationOffset parameters are optional, but they are useful for clients who store GraphQL documents in source files. For example, if the GraphQL input starts at line 40 in a file named Foo.graphql, it might be useful for name to be "Foo.graphql" and location to be { line: 40, column: 1 }. The line and column properties in locationOffset are 1-indexed.

4 nested properties
body string
name string
locationOffset object
__@toStringTag@38 string
__@toStringTag@38 string
value boolean
Kind.BOOLEAN string
NullValueNode object
kind string
Values: "NullValue"
loc object

Contains a range of UTF-8 character offsets and token references that identify the region of the source from which the AST derived.

6 nested properties
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

startToken object

Represents a range of characters represented by a lexical token within a Source.

9 nested properties
kind string

An exported enum describing the different kinds of tokens that the lexer emits.

Values: "!" "$" "&" "(" ")" "..." ":" "<EOF>" "<SOF>" "=" "@" "BlockString" "Comment" "Float" "Int" "Name" "String" "[" "]" "{" "|" "}"
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

line number

The 1-indexed line number on which this Token appears.

column number

The 1-indexed column number at which this Token begins.

value string

For non-punctuation tokens, represents the interpreted value of the token.

Note: is undefined for punctuation tokens, but typed as string for convenience in the parser.

prev object

Represents a range of characters represented by a lexical token within a Source.

next object

Represents a range of characters represented by a lexical token within a Source.

__@toStringTag@38 string
endToken object

Represents a range of characters represented by a lexical token within a Source.

9 nested properties
kind string

An exported enum describing the different kinds of tokens that the lexer emits.

Values: "!" "$" "&" "(" ")" "..." ":" "<EOF>" "<SOF>" "=" "@" "BlockString" "Comment" "Float" "Int" "Name" "String" "[" "]" "{" "|" "}"
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

line number

The 1-indexed line number on which this Token appears.

column number

The 1-indexed column number at which this Token begins.

value string

For non-punctuation tokens, represents the interpreted value of the token.

Note: is undefined for punctuation tokens, but typed as string for convenience in the parser.

prev object

Represents a range of characters represented by a lexical token within a Source.

next object

Represents a range of characters represented by a lexical token within a Source.

__@toStringTag@38 string
source object

A representation of source input to GraphQL. The name and locationOffset parameters are optional, but they are useful for clients who store GraphQL documents in source files. For example, if the GraphQL input starts at line 40 in a file named Foo.graphql, it might be useful for name to be "Foo.graphql" and location to be { line: 40, column: 1 }. The line and column properties in locationOffset are 1-indexed.

4 nested properties
body string
name string
locationOffset object
__@toStringTag@38 string
__@toStringTag@38 string
Kind.NULL string
EnumValueNode object
kind string
Values: "EnumValue"
loc object

Contains a range of UTF-8 character offsets and token references that identify the region of the source from which the AST derived.

6 nested properties
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

startToken object

Represents a range of characters represented by a lexical token within a Source.

9 nested properties
kind string

An exported enum describing the different kinds of tokens that the lexer emits.

Values: "!" "$" "&" "(" ")" "..." ":" "<EOF>" "<SOF>" "=" "@" "BlockString" "Comment" "Float" "Int" "Name" "String" "[" "]" "{" "|" "}"
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

line number

The 1-indexed line number on which this Token appears.

column number

The 1-indexed column number at which this Token begins.

value string

For non-punctuation tokens, represents the interpreted value of the token.

Note: is undefined for punctuation tokens, but typed as string for convenience in the parser.

prev object

Represents a range of characters represented by a lexical token within a Source.

next object

Represents a range of characters represented by a lexical token within a Source.

__@toStringTag@38 string
endToken object

Represents a range of characters represented by a lexical token within a Source.

9 nested properties
kind string

An exported enum describing the different kinds of tokens that the lexer emits.

Values: "!" "$" "&" "(" ")" "..." ":" "<EOF>" "<SOF>" "=" "@" "BlockString" "Comment" "Float" "Int" "Name" "String" "[" "]" "{" "|" "}"
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

line number

The 1-indexed line number on which this Token appears.

column number

The 1-indexed column number at which this Token begins.

value string

For non-punctuation tokens, represents the interpreted value of the token.

Note: is undefined for punctuation tokens, but typed as string for convenience in the parser.

prev object

Represents a range of characters represented by a lexical token within a Source.

next object

Represents a range of characters represented by a lexical token within a Source.

__@toStringTag@38 string
source object

A representation of source input to GraphQL. The name and locationOffset parameters are optional, but they are useful for clients who store GraphQL documents in source files. For example, if the GraphQL input starts at line 40 in a file named Foo.graphql, it might be useful for name to be "Foo.graphql" and location to be { line: 40, column: 1 }. The line and column properties in locationOffset are 1-indexed.

4 nested properties
body string
name string
locationOffset object
__@toStringTag@38 string
__@toStringTag@38 string
value string
Kind.ENUM string
ConstListValueNode object
kind string
Values: "ListValue"
loc object

Contains a range of UTF-8 character offsets and token references that identify the region of the source from which the AST derived.

6 nested properties
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

startToken object

Represents a range of characters represented by a lexical token within a Source.

9 nested properties
kind string

An exported enum describing the different kinds of tokens that the lexer emits.

Values: "!" "$" "&" "(" ")" "..." ":" "<EOF>" "<SOF>" "=" "@" "BlockString" "Comment" "Float" "Int" "Name" "String" "[" "]" "{" "|" "}"
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

line number

The 1-indexed line number on which this Token appears.

column number

The 1-indexed column number at which this Token begins.

value string

For non-punctuation tokens, represents the interpreted value of the token.

Note: is undefined for punctuation tokens, but typed as string for convenience in the parser.

prev object

Represents a range of characters represented by a lexical token within a Source.

next object

Represents a range of characters represented by a lexical token within a Source.

__@toStringTag@38 string
endToken object

Represents a range of characters represented by a lexical token within a Source.

9 nested properties
kind string

An exported enum describing the different kinds of tokens that the lexer emits.

Values: "!" "$" "&" "(" ")" "..." ":" "<EOF>" "<SOF>" "=" "@" "BlockString" "Comment" "Float" "Int" "Name" "String" "[" "]" "{" "|" "}"
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

line number

The 1-indexed line number on which this Token appears.

column number

The 1-indexed column number at which this Token begins.

value string

For non-punctuation tokens, represents the interpreted value of the token.

Note: is undefined for punctuation tokens, but typed as string for convenience in the parser.

prev object

Represents a range of characters represented by a lexical token within a Source.

next object

Represents a range of characters represented by a lexical token within a Source.

__@toStringTag@38 string
source object

A representation of source input to GraphQL. The name and locationOffset parameters are optional, but they are useful for clients who store GraphQL documents in source files. For example, if the GraphQL input starts at line 40 in a file named Foo.graphql, it might be useful for name to be "Foo.graphql" and location to be { line: 40, column: 1 }. The line and column properties in locationOffset are 1-indexed.

4 nested properties
body string
name string
locationOffset object
__@toStringTag@38 string
__@toStringTag@38 string
Kind.LIST string
ReadonlyArray_2 ConstValueNode[]
ConstObjectValueNode object
kind string
Values: "ObjectValue"
loc object

Contains a range of UTF-8 character offsets and token references that identify the region of the source from which the AST derived.

6 nested properties
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

startToken object

Represents a range of characters represented by a lexical token within a Source.

9 nested properties
kind string

An exported enum describing the different kinds of tokens that the lexer emits.

Values: "!" "$" "&" "(" ")" "..." ":" "<EOF>" "<SOF>" "=" "@" "BlockString" "Comment" "Float" "Int" "Name" "String" "[" "]" "{" "|" "}"
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

line number

The 1-indexed line number on which this Token appears.

column number

The 1-indexed column number at which this Token begins.

value string

For non-punctuation tokens, represents the interpreted value of the token.

Note: is undefined for punctuation tokens, but typed as string for convenience in the parser.

prev object

Represents a range of characters represented by a lexical token within a Source.

next object

Represents a range of characters represented by a lexical token within a Source.

__@toStringTag@38 string
endToken object

Represents a range of characters represented by a lexical token within a Source.

9 nested properties
kind string

An exported enum describing the different kinds of tokens that the lexer emits.

Values: "!" "$" "&" "(" ")" "..." ":" "<EOF>" "<SOF>" "=" "@" "BlockString" "Comment" "Float" "Int" "Name" "String" "[" "]" "{" "|" "}"
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

line number

The 1-indexed line number on which this Token appears.

column number

The 1-indexed column number at which this Token begins.

value string

For non-punctuation tokens, represents the interpreted value of the token.

Note: is undefined for punctuation tokens, but typed as string for convenience in the parser.

prev object

Represents a range of characters represented by a lexical token within a Source.

next object

Represents a range of characters represented by a lexical token within a Source.

__@toStringTag@38 string
source object

A representation of source input to GraphQL. The name and locationOffset parameters are optional, but they are useful for clients who store GraphQL documents in source files. For example, if the GraphQL input starts at line 40 in a file named Foo.graphql, it might be useful for name to be "Foo.graphql" and location to be { line: 40, column: 1 }. The line and column properties in locationOffset are 1-indexed.

4 nested properties
body string
name string
locationOffset object
__@toStringTag@38 string
__@toStringTag@38 string
Kind.OBJECT string
ReadonlyArray_3 ConstObjectFieldNode[]
ConstObjectFieldNode object
kind string
Values: "ObjectField"
loc object

Contains a range of UTF-8 character offsets and token references that identify the region of the source from which the AST derived.

6 nested properties
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

startToken object

Represents a range of characters represented by a lexical token within a Source.

9 nested properties
kind string

An exported enum describing the different kinds of tokens that the lexer emits.

Values: "!" "$" "&" "(" ")" "..." ":" "<EOF>" "<SOF>" "=" "@" "BlockString" "Comment" "Float" "Int" "Name" "String" "[" "]" "{" "|" "}"
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

line number

The 1-indexed line number on which this Token appears.

column number

The 1-indexed column number at which this Token begins.

value string

For non-punctuation tokens, represents the interpreted value of the token.

Note: is undefined for punctuation tokens, but typed as string for convenience in the parser.

prev object

Represents a range of characters represented by a lexical token within a Source.

next object

Represents a range of characters represented by a lexical token within a Source.

__@toStringTag@38 string
endToken object

Represents a range of characters represented by a lexical token within a Source.

9 nested properties
kind string

An exported enum describing the different kinds of tokens that the lexer emits.

Values: "!" "$" "&" "(" ")" "..." ":" "<EOF>" "<SOF>" "=" "@" "BlockString" "Comment" "Float" "Int" "Name" "String" "[" "]" "{" "|" "}"
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

line number

The 1-indexed line number on which this Token appears.

column number

The 1-indexed column number at which this Token begins.

value string

For non-punctuation tokens, represents the interpreted value of the token.

Note: is undefined for punctuation tokens, but typed as string for convenience in the parser.

prev object

Represents a range of characters represented by a lexical token within a Source.

next object

Represents a range of characters represented by a lexical token within a Source.

__@toStringTag@38 string
source object

A representation of source input to GraphQL. The name and locationOffset parameters are optional, but they are useful for clients who store GraphQL documents in source files. For example, if the GraphQL input starts at line 40 in a file named Foo.graphql, it might be useful for name to be "Foo.graphql" and location to be { line: 40, column: 1 }. The line and column properties in locationOffset are 1-indexed.

4 nested properties
body string
name string
locationOffset object
__@toStringTag@38 string
__@toStringTag@38 string
name object

Name

3 nested properties
kind string

Name

Values: "Name"
loc object

Contains a range of UTF-8 character offsets and token references that identify the region of the source from which the AST derived.

6 nested properties
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

startToken object

Represents a range of characters represented by a lexical token within a Source.

endToken object

Represents a range of characters represented by a lexical token within a Source.

source object

A representation of source input to GraphQL. The name and locationOffset parameters are optional, but they are useful for clients who store GraphQL documents in source files. For example, if the GraphQL input starts at line 40 in a file named Foo.graphql, it might be useful for name to be "Foo.graphql" and location to be { line: 40, column: 1 }. The line and column properties in locationOffset are 1-indexed.

__@toStringTag@38 string
value string
Kind.OBJECT_FIELD string
ReadonlyArray_4 OperationTypeDefinitionNode[]
OperationTypeDefinitionNode object
kind string
Values: "OperationTypeDefinition"
loc object

Contains a range of UTF-8 character offsets and token references that identify the region of the source from which the AST derived.

6 nested properties
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

startToken object

Represents a range of characters represented by a lexical token within a Source.

9 nested properties
kind string

An exported enum describing the different kinds of tokens that the lexer emits.

Values: "!" "$" "&" "(" ")" "..." ":" "<EOF>" "<SOF>" "=" "@" "BlockString" "Comment" "Float" "Int" "Name" "String" "[" "]" "{" "|" "}"
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

line number

The 1-indexed line number on which this Token appears.

column number

The 1-indexed column number at which this Token begins.

value string

For non-punctuation tokens, represents the interpreted value of the token.

Note: is undefined for punctuation tokens, but typed as string for convenience in the parser.

prev object

Represents a range of characters represented by a lexical token within a Source.

next object

Represents a range of characters represented by a lexical token within a Source.

__@toStringTag@38 string
endToken object

Represents a range of characters represented by a lexical token within a Source.

9 nested properties
kind string

An exported enum describing the different kinds of tokens that the lexer emits.

Values: "!" "$" "&" "(" ")" "..." ":" "<EOF>" "<SOF>" "=" "@" "BlockString" "Comment" "Float" "Int" "Name" "String" "[" "]" "{" "|" "}"
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

line number

The 1-indexed line number on which this Token appears.

column number

The 1-indexed column number at which this Token begins.

value string

For non-punctuation tokens, represents the interpreted value of the token.

Note: is undefined for punctuation tokens, but typed as string for convenience in the parser.

prev object

Represents a range of characters represented by a lexical token within a Source.

next object

Represents a range of characters represented by a lexical token within a Source.

__@toStringTag@38 string
source object

A representation of source input to GraphQL. The name and locationOffset parameters are optional, but they are useful for clients who store GraphQL documents in source files. For example, if the GraphQL input starts at line 40 in a file named Foo.graphql, it might be useful for name to be "Foo.graphql" and location to be { line: 40, column: 1 }. The line and column properties in locationOffset are 1-indexed.

4 nested properties
body string
name string
locationOffset object
__@toStringTag@38 string
__@toStringTag@38 string
operation string
Values: "mutation" "query" "subscription"
type object
3 nested properties
kind string

Types

Values: "NamedType"
loc object

Contains a range of UTF-8 character offsets and token references that identify the region of the source from which the AST derived.

6 nested properties
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

startToken object

Represents a range of characters represented by a lexical token within a Source.

endToken object

Represents a range of characters represented by a lexical token within a Source.

source object

A representation of source input to GraphQL. The name and locationOffset parameters are optional, but they are useful for clients who store GraphQL documents in source files. For example, if the GraphQL input starts at line 40 in a file named Foo.graphql, it might be useful for name to be "Foo.graphql" and location to be { line: 40, column: 1 }. The line and column properties in locationOffset are 1-indexed.

__@toStringTag@38 string
name object

Name

3 nested properties
kind string

Name

Values: "Name"
loc object

Contains a range of UTF-8 character offsets and token references that identify the region of the source from which the AST derived.

value string
Kind.OPERATION_TYPE_DEFINITION string
OperationTypeNode string
NamedTypeNode object
kind string

Types

Values: "NamedType"
loc object

Contains a range of UTF-8 character offsets and token references that identify the region of the source from which the AST derived.

6 nested properties
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

startToken object

Represents a range of characters represented by a lexical token within a Source.

9 nested properties
kind string

An exported enum describing the different kinds of tokens that the lexer emits.

Values: "!" "$" "&" "(" ")" "..." ":" "<EOF>" "<SOF>" "=" "@" "BlockString" "Comment" "Float" "Int" "Name" "String" "[" "]" "{" "|" "}"
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

line number

The 1-indexed line number on which this Token appears.

column number

The 1-indexed column number at which this Token begins.

value string

For non-punctuation tokens, represents the interpreted value of the token.

Note: is undefined for punctuation tokens, but typed as string for convenience in the parser.

prev object

Represents a range of characters represented by a lexical token within a Source.

next object

Represents a range of characters represented by a lexical token within a Source.

__@toStringTag@38 string
endToken object

Represents a range of characters represented by a lexical token within a Source.

9 nested properties
kind string

An exported enum describing the different kinds of tokens that the lexer emits.

Values: "!" "$" "&" "(" ")" "..." ":" "<EOF>" "<SOF>" "=" "@" "BlockString" "Comment" "Float" "Int" "Name" "String" "[" "]" "{" "|" "}"
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

line number

The 1-indexed line number on which this Token appears.

column number

The 1-indexed column number at which this Token begins.

value string

For non-punctuation tokens, represents the interpreted value of the token.

Note: is undefined for punctuation tokens, but typed as string for convenience in the parser.

prev object

Represents a range of characters represented by a lexical token within a Source.

next object

Represents a range of characters represented by a lexical token within a Source.

__@toStringTag@38 string
source object

A representation of source input to GraphQL. The name and locationOffset parameters are optional, but they are useful for clients who store GraphQL documents in source files. For example, if the GraphQL input starts at line 40 in a file named Foo.graphql, it might be useful for name to be "Foo.graphql" and location to be { line: 40, column: 1 }. The line and column properties in locationOffset are 1-indexed.

4 nested properties
body string
name string
locationOffset object
__@toStringTag@38 string
__@toStringTag@38 string
name object

Name

3 nested properties
kind string

Name

Values: "Name"
loc object

Contains a range of UTF-8 character offsets and token references that identify the region of the source from which the AST derived.

6 nested properties
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

startToken object

Represents a range of characters represented by a lexical token within a Source.

endToken object

Represents a range of characters represented by a lexical token within a Source.

source object

A representation of source input to GraphQL. The name and locationOffset parameters are optional, but they are useful for clients who store GraphQL documents in source files. For example, if the GraphQL input starts at line 40 in a file named Foo.graphql, it might be useful for name to be "Foo.graphql" and location to be { line: 40, column: 1 }. The line and column properties in locationOffset are 1-indexed.

__@toStringTag@38 string
value string
Kind.NAMED_TYPE string

Types

Maybe_1 object
kind string

Type System Definitions

Values: "SchemaDefinition"
loc object

Contains a range of UTF-8 character offsets and token references that identify the region of the source from which the AST derived.

6 nested properties
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

startToken object

Represents a range of characters represented by a lexical token within a Source.

9 nested properties
kind string

An exported enum describing the different kinds of tokens that the lexer emits.

Values: "!" "$" "&" "(" ")" "..." ":" "<EOF>" "<SOF>" "=" "@" "BlockString" "Comment" "Float" "Int" "Name" "String" "[" "]" "{" "|" "}"
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

line number

The 1-indexed line number on which this Token appears.

column number

The 1-indexed column number at which this Token begins.

value string

For non-punctuation tokens, represents the interpreted value of the token.

Note: is undefined for punctuation tokens, but typed as string for convenience in the parser.

prev object

Represents a range of characters represented by a lexical token within a Source.

next object

Represents a range of characters represented by a lexical token within a Source.

__@toStringTag@38 string
endToken object

Represents a range of characters represented by a lexical token within a Source.

9 nested properties
kind string

An exported enum describing the different kinds of tokens that the lexer emits.

Values: "!" "$" "&" "(" ")" "..." ":" "<EOF>" "<SOF>" "=" "@" "BlockString" "Comment" "Float" "Int" "Name" "String" "[" "]" "{" "|" "}"
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

line number

The 1-indexed line number on which this Token appears.

column number

The 1-indexed column number at which this Token begins.

value string

For non-punctuation tokens, represents the interpreted value of the token.

Note: is undefined for punctuation tokens, but typed as string for convenience in the parser.

prev object

Represents a range of characters represented by a lexical token within a Source.

next object

Represents a range of characters represented by a lexical token within a Source.

__@toStringTag@38 string
source object

A representation of source input to GraphQL. The name and locationOffset parameters are optional, but they are useful for clients who store GraphQL documents in source files. For example, if the GraphQL input starts at line 40 in a file named Foo.graphql, it might be useful for name to be "Foo.graphql" and location to be { line: 40, column: 1 }. The line and column properties in locationOffset are 1-indexed.

4 nested properties
body string
name string
locationOffset object
__@toStringTag@38 string
__@toStringTag@38 string
description object
4 nested properties
kind string
Values: "StringValue"
loc object

Contains a range of UTF-8 character offsets and token references that identify the region of the source from which the AST derived.

6 nested properties
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

startToken object

Represents a range of characters represented by a lexical token within a Source.

endToken object

Represents a range of characters represented by a lexical token within a Source.

source object

A representation of source input to GraphQL. The name and locationOffset parameters are optional, but they are useful for clients who store GraphQL documents in source files. For example, if the GraphQL input starts at line 40 in a file named Foo.graphql, it might be useful for name to be "Foo.graphql" and location to be { line: 40, column: 1 }. The line and column properties in locationOffset are 1-indexed.

__@toStringTag@38 string
value string
block boolean
ReadonlyArray_5 SchemaExtensionNode[]
SchemaExtensionNode object
kind string

Type System Extensions

Values: "SchemaExtension"
loc object

Contains a range of UTF-8 character offsets and token references that identify the region of the source from which the AST derived.

6 nested properties
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

startToken object

Represents a range of characters represented by a lexical token within a Source.

9 nested properties
kind string

An exported enum describing the different kinds of tokens that the lexer emits.

Values: "!" "$" "&" "(" ")" "..." ":" "<EOF>" "<SOF>" "=" "@" "BlockString" "Comment" "Float" "Int" "Name" "String" "[" "]" "{" "|" "}"
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

line number

The 1-indexed line number on which this Token appears.

column number

The 1-indexed column number at which this Token begins.

value string

For non-punctuation tokens, represents the interpreted value of the token.

Note: is undefined for punctuation tokens, but typed as string for convenience in the parser.

prev object

Represents a range of characters represented by a lexical token within a Source.

next object

Represents a range of characters represented by a lexical token within a Source.

__@toStringTag@38 string
endToken object

Represents a range of characters represented by a lexical token within a Source.

9 nested properties
kind string

An exported enum describing the different kinds of tokens that the lexer emits.

Values: "!" "$" "&" "(" ")" "..." ":" "<EOF>" "<SOF>" "=" "@" "BlockString" "Comment" "Float" "Int" "Name" "String" "[" "]" "{" "|" "}"
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

line number

The 1-indexed line number on which this Token appears.

column number

The 1-indexed column number at which this Token begins.

value string

For non-punctuation tokens, represents the interpreted value of the token.

Note: is undefined for punctuation tokens, but typed as string for convenience in the parser.

prev object

Represents a range of characters represented by a lexical token within a Source.

next object

Represents a range of characters represented by a lexical token within a Source.

__@toStringTag@38 string
source object

A representation of source input to GraphQL. The name and locationOffset parameters are optional, but they are useful for clients who store GraphQL documents in source files. For example, if the GraphQL input starts at line 40 in a file named Foo.graphql, it might be useful for name to be "Foo.graphql" and location to be { line: 40, column: 1 }. The line and column properties in locationOffset are 1-indexed.

4 nested properties
body string
name string
locationOffset object
__@toStringTag@38 string
__@toStringTag@38 string
Kind.SCHEMA_EXTENSION string

Type System Extensions

ReadonlyArray_6 GraphQLError[]
GraphQLError object

A GraphQLError describes an Error found during the parse, validate, or execute phases of performing a GraphQL operation. In addition to a message and stack trace, it also includes information about the locations in a GraphQL document and/or execution result that correspond to the Error.

locations SourceLocation[]

An array of { line, column } locations within the source GraphQL document which correspond to this error.

Errors during validation often contain multiple locations, for example to point out two things with the same name. Errors during execution include a single location, the field which produced the error.

Enumerable, and appears in the result of JSON.stringify().

path string | number[]

An array describing the JSON-path into the execution response which corresponds to this error. Only included for errors during execution.

Enumerable, and appears in the result of JSON.stringify().

nodes ASTNode[]

An array of GraphQL AST Nodes corresponding to this error.

source object

A representation of source input to GraphQL. The name and locationOffset parameters are optional, but they are useful for clients who store GraphQL documents in source files. For example, if the GraphQL input starts at line 40 in a file named Foo.graphql, it might be useful for name to be "Foo.graphql" and location to be { line: 40, column: 1 }. The line and column properties in locationOffset are 1-indexed.

4 nested properties
body string
name string
locationOffset object
2 nested properties
line number
column number
__@toStringTag@38 string
positions number[]

An array of character offsets within the source GraphQL document which correspond to this error.

originalError object
3 nested properties
name string
message string
stack string
extensions Record<string, any>

Custom extensions

coordinate string

An optional schema coordinate (e.g. "MyType.myField") associated with this error.

__@toStringTag@38 string
name string
message string
stack string
SourceLocation object

Represents a location in a Source.

line number
column number
ASTNode DocumentNode | NameNode | OperationDefinitionNode | VariableDefinitionNode | VariableNode | SelectionSetNode | FieldNode | ArgumentNode | FragmentSpreadNode | InlineFragmentNode | FragmentDefinitionNode | IntValueNode | FloatValueNode | StringValueNode | BooleanValueNode | NullValueNode | EnumValueNode | ListValueNode | ObjectValueNode | ObjectFieldNode | DirectiveNode | NamedTypeNode | ListTypeNode | NonNullTypeNode | SchemaDefinitionNode | OperationTypeDefinitionNode | ScalarTypeDefinitionNode | ObjectTypeDefinitionNode | FieldDefinitionNode | InputValueDefinitionNode | InterfaceTypeDefinitionNode | UnionTypeDefinitionNode | EnumTypeDefinitionNode | EnumValueDefinitionNode | InputObjectTypeDefinitionNode | DirectiveDefinitionNode | SchemaExtensionNode | ScalarTypeExtensionNode | ObjectTypeExtensionNode | InterfaceTypeExtensionNode | UnionTypeExtensionNode | EnumTypeExtensionNode | InputObjectTypeExtensionNode

The list of all possible AST node types.

DocumentNode object

Document

kind string

Document

Values: "Document"
loc object

Contains a range of UTF-8 character offsets and token references that identify the region of the source from which the AST derived.

6 nested properties
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

startToken object

Represents a range of characters represented by a lexical token within a Source.

9 nested properties
kind string

An exported enum describing the different kinds of tokens that the lexer emits.

Values: "!" "$" "&" "(" ")" "..." ":" "<EOF>" "<SOF>" "=" "@" "BlockString" "Comment" "Float" "Int" "Name" "String" "[" "]" "{" "|" "}"
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

line number

The 1-indexed line number on which this Token appears.

column number

The 1-indexed column number at which this Token begins.

value string

For non-punctuation tokens, represents the interpreted value of the token.

Note: is undefined for punctuation tokens, but typed as string for convenience in the parser.

prev object

Represents a range of characters represented by a lexical token within a Source.

next object

Represents a range of characters represented by a lexical token within a Source.

__@toStringTag@38 string
endToken object

Represents a range of characters represented by a lexical token within a Source.

9 nested properties
kind string

An exported enum describing the different kinds of tokens that the lexer emits.

Values: "!" "$" "&" "(" ")" "..." ":" "<EOF>" "<SOF>" "=" "@" "BlockString" "Comment" "Float" "Int" "Name" "String" "[" "]" "{" "|" "}"
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

line number

The 1-indexed line number on which this Token appears.

column number

The 1-indexed column number at which this Token begins.

value string

For non-punctuation tokens, represents the interpreted value of the token.

Note: is undefined for punctuation tokens, but typed as string for convenience in the parser.

prev object

Represents a range of characters represented by a lexical token within a Source.

next object

Represents a range of characters represented by a lexical token within a Source.

__@toStringTag@38 string
source object

A representation of source input to GraphQL. The name and locationOffset parameters are optional, but they are useful for clients who store GraphQL documents in source files. For example, if the GraphQL input starts at line 40 in a file named Foo.graphql, it might be useful for name to be "Foo.graphql" and location to be { line: 40, column: 1 }. The line and column properties in locationOffset are 1-indexed.

4 nested properties
body string
name string
locationOffset object
__@toStringTag@38 string
__@toStringTag@38 string
definitions DefinitionNode[]
Kind.DOCUMENT string

Document

ReadonlyArray_7 DefinitionNode[]
DefinitionNode OperationDefinitionNode | FragmentDefinitionNode | SchemaDefinitionNode | ScalarTypeDefinitionNode | ObjectTypeDefinitionNode | InterfaceTypeDefinitionNode | UnionTypeDefinitionNode | EnumTypeDefinitionNode | InputObjectTypeDefinitionNode | DirectiveDefinitionNode | SchemaExtensionNode | ScalarTypeExtensionNode | ObjectTypeExtensionNode | InterfaceTypeExtensionNode | UnionTypeExtensionNode | EnumTypeExtensionNode | InputObjectTypeExtensionNode
OperationDefinitionNode object
kind string
Values: "OperationDefinition"
loc object

Contains a range of UTF-8 character offsets and token references that identify the region of the source from which the AST derived.

6 nested properties
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

startToken object

Represents a range of characters represented by a lexical token within a Source.

9 nested properties
kind string

An exported enum describing the different kinds of tokens that the lexer emits.

Values: "!" "$" "&" "(" ")" "..." ":" "<EOF>" "<SOF>" "=" "@" "BlockString" "Comment" "Float" "Int" "Name" "String" "[" "]" "{" "|" "}"
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

line number

The 1-indexed line number on which this Token appears.

column number

The 1-indexed column number at which this Token begins.

value string

For non-punctuation tokens, represents the interpreted value of the token.

Note: is undefined for punctuation tokens, but typed as string for convenience in the parser.

prev object

Represents a range of characters represented by a lexical token within a Source.

next object

Represents a range of characters represented by a lexical token within a Source.

__@toStringTag@38 string
endToken object

Represents a range of characters represented by a lexical token within a Source.

9 nested properties
kind string

An exported enum describing the different kinds of tokens that the lexer emits.

Values: "!" "$" "&" "(" ")" "..." ":" "<EOF>" "<SOF>" "=" "@" "BlockString" "Comment" "Float" "Int" "Name" "String" "[" "]" "{" "|" "}"
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

line number

The 1-indexed line number on which this Token appears.

column number

The 1-indexed column number at which this Token begins.

value string

For non-punctuation tokens, represents the interpreted value of the token.

Note: is undefined for punctuation tokens, but typed as string for convenience in the parser.

prev object

Represents a range of characters represented by a lexical token within a Source.

next object

Represents a range of characters represented by a lexical token within a Source.

__@toStringTag@38 string
source object

A representation of source input to GraphQL. The name and locationOffset parameters are optional, but they are useful for clients who store GraphQL documents in source files. For example, if the GraphQL input starts at line 40 in a file named Foo.graphql, it might be useful for name to be "Foo.graphql" and location to be { line: 40, column: 1 }. The line and column properties in locationOffset are 1-indexed.

4 nested properties
body string
name string
locationOffset object
__@toStringTag@38 string
__@toStringTag@38 string
operation string
Values: "mutation" "query" "subscription"
name object

Name

3 nested properties
kind string

Name

Values: "Name"
loc object

Contains a range of UTF-8 character offsets and token references that identify the region of the source from which the AST derived.

6 nested properties
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

startToken object

Represents a range of characters represented by a lexical token within a Source.

endToken object

Represents a range of characters represented by a lexical token within a Source.

source object

A representation of source input to GraphQL. The name and locationOffset parameters are optional, but they are useful for clients who store GraphQL documents in source files. For example, if the GraphQL input starts at line 40 in a file named Foo.graphql, it might be useful for name to be "Foo.graphql" and location to be { line: 40, column: 1 }. The line and column properties in locationOffset are 1-indexed.

__@toStringTag@38 string
value string
variableDefinitions VariableDefinitionNode[]
directives DirectiveNode[]
selectionSet object
3 nested properties
kind string
Values: "SelectionSet"
loc object

Contains a range of UTF-8 character offsets and token references that identify the region of the source from which the AST derived.

6 nested properties
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

startToken object

Represents a range of characters represented by a lexical token within a Source.

endToken object

Represents a range of characters represented by a lexical token within a Source.

source object

A representation of source input to GraphQL. The name and locationOffset parameters are optional, but they are useful for clients who store GraphQL documents in source files. For example, if the GraphQL input starts at line 40 in a file named Foo.graphql, it might be useful for name to be "Foo.graphql" and location to be { line: 40, column: 1 }. The line and column properties in locationOffset are 1-indexed.

__@toStringTag@38 string
selections SelectionNode[]
Kind.OPERATION_DEFINITION string
ReadonlyArray_8 VariableDefinitionNode[]
VariableDefinitionNode object
kind string
Values: "VariableDefinition"
loc object

Contains a range of UTF-8 character offsets and token references that identify the region of the source from which the AST derived.

6 nested properties
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

startToken object

Represents a range of characters represented by a lexical token within a Source.

9 nested properties
kind string

An exported enum describing the different kinds of tokens that the lexer emits.

Values: "!" "$" "&" "(" ")" "..." ":" "<EOF>" "<SOF>" "=" "@" "BlockString" "Comment" "Float" "Int" "Name" "String" "[" "]" "{" "|" "}"
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

line number

The 1-indexed line number on which this Token appears.

column number

The 1-indexed column number at which this Token begins.

value string

For non-punctuation tokens, represents the interpreted value of the token.

Note: is undefined for punctuation tokens, but typed as string for convenience in the parser.

prev object

Represents a range of characters represented by a lexical token within a Source.

next object

Represents a range of characters represented by a lexical token within a Source.

__@toStringTag@38 string
endToken object

Represents a range of characters represented by a lexical token within a Source.

9 nested properties
kind string

An exported enum describing the different kinds of tokens that the lexer emits.

Values: "!" "$" "&" "(" ")" "..." ":" "<EOF>" "<SOF>" "=" "@" "BlockString" "Comment" "Float" "Int" "Name" "String" "[" "]" "{" "|" "}"
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

line number

The 1-indexed line number on which this Token appears.

column number

The 1-indexed column number at which this Token begins.

value string

For non-punctuation tokens, represents the interpreted value of the token.

Note: is undefined for punctuation tokens, but typed as string for convenience in the parser.

prev object

Represents a range of characters represented by a lexical token within a Source.

next object

Represents a range of characters represented by a lexical token within a Source.

__@toStringTag@38 string
source object

A representation of source input to GraphQL. The name and locationOffset parameters are optional, but they are useful for clients who store GraphQL documents in source files. For example, if the GraphQL input starts at line 40 in a file named Foo.graphql, it might be useful for name to be "Foo.graphql" and location to be { line: 40, column: 1 }. The line and column properties in locationOffset are 1-indexed.

4 nested properties
body string
name string
locationOffset object
__@toStringTag@38 string
__@toStringTag@38 string
variable object
3 nested properties
kind string

Values

Values: "Variable"
loc object

Contains a range of UTF-8 character offsets and token references that identify the region of the source from which the AST derived.

6 nested properties
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

startToken object

Represents a range of characters represented by a lexical token within a Source.

endToken object

Represents a range of characters represented by a lexical token within a Source.

source object

A representation of source input to GraphQL. The name and locationOffset parameters are optional, but they are useful for clients who store GraphQL documents in source files. For example, if the GraphQL input starts at line 40 in a file named Foo.graphql, it might be useful for name to be "Foo.graphql" and location to be { line: 40, column: 1 }. The line and column properties in locationOffset are 1-indexed.

__@toStringTag@38 string
name object

Name

3 nested properties
kind string

Name

Values: "Name"
loc object

Contains a range of UTF-8 character offsets and token references that identify the region of the source from which the AST derived.

value string

Type Reference

Kind.VARIABLE_DEFINITION string
VariableNode object
kind string

Values

Values: "Variable"
loc object

Contains a range of UTF-8 character offsets and token references that identify the region of the source from which the AST derived.

6 nested properties
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

startToken object

Represents a range of characters represented by a lexical token within a Source.

9 nested properties
kind string

An exported enum describing the different kinds of tokens that the lexer emits.

Values: "!" "$" "&" "(" ")" "..." ":" "<EOF>" "<SOF>" "=" "@" "BlockString" "Comment" "Float" "Int" "Name" "String" "[" "]" "{" "|" "}"
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

line number

The 1-indexed line number on which this Token appears.

column number

The 1-indexed column number at which this Token begins.

value string

For non-punctuation tokens, represents the interpreted value of the token.

Note: is undefined for punctuation tokens, but typed as string for convenience in the parser.

prev object

Represents a range of characters represented by a lexical token within a Source.

next object

Represents a range of characters represented by a lexical token within a Source.

__@toStringTag@38 string
endToken object

Represents a range of characters represented by a lexical token within a Source.

9 nested properties
kind string

An exported enum describing the different kinds of tokens that the lexer emits.

Values: "!" "$" "&" "(" ")" "..." ":" "<EOF>" "<SOF>" "=" "@" "BlockString" "Comment" "Float" "Int" "Name" "String" "[" "]" "{" "|" "}"
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

line number

The 1-indexed line number on which this Token appears.

column number

The 1-indexed column number at which this Token begins.

value string

For non-punctuation tokens, represents the interpreted value of the token.

Note: is undefined for punctuation tokens, but typed as string for convenience in the parser.

prev object

Represents a range of characters represented by a lexical token within a Source.

next object

Represents a range of characters represented by a lexical token within a Source.

__@toStringTag@38 string
source object

A representation of source input to GraphQL. The name and locationOffset parameters are optional, but they are useful for clients who store GraphQL documents in source files. For example, if the GraphQL input starts at line 40 in a file named Foo.graphql, it might be useful for name to be "Foo.graphql" and location to be { line: 40, column: 1 }. The line and column properties in locationOffset are 1-indexed.

4 nested properties
body string
name string
locationOffset object
__@toStringTag@38 string
__@toStringTag@38 string
name object

Name

3 nested properties
kind string

Name

Values: "Name"
loc object

Contains a range of UTF-8 character offsets and token references that identify the region of the source from which the AST derived.

6 nested properties
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

startToken object

Represents a range of characters represented by a lexical token within a Source.

endToken object

Represents a range of characters represented by a lexical token within a Source.

source object

A representation of source input to GraphQL. The name and locationOffset parameters are optional, but they are useful for clients who store GraphQL documents in source files. For example, if the GraphQL input starts at line 40 in a file named Foo.graphql, it might be useful for name to be "Foo.graphql" and location to be { line: 40, column: 1 }. The line and column properties in locationOffset are 1-indexed.

__@toStringTag@38 string
value string
Kind.VARIABLE string

Values

TypeNode NamedTypeNode | ListTypeNode | NonNullTypeNode

Type Reference

ListTypeNode object
kind string
Values: "ListType"
loc object

Contains a range of UTF-8 character offsets and token references that identify the region of the source from which the AST derived.

6 nested properties
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

startToken object

Represents a range of characters represented by a lexical token within a Source.

9 nested properties
kind string

An exported enum describing the different kinds of tokens that the lexer emits.

Values: "!" "$" "&" "(" ")" "..." ":" "<EOF>" "<SOF>" "=" "@" "BlockString" "Comment" "Float" "Int" "Name" "String" "[" "]" "{" "|" "}"
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

line number

The 1-indexed line number on which this Token appears.

column number

The 1-indexed column number at which this Token begins.

value string

For non-punctuation tokens, represents the interpreted value of the token.

Note: is undefined for punctuation tokens, but typed as string for convenience in the parser.

prev object

Represents a range of characters represented by a lexical token within a Source.

next object

Represents a range of characters represented by a lexical token within a Source.

__@toStringTag@38 string
endToken object

Represents a range of characters represented by a lexical token within a Source.

9 nested properties
kind string

An exported enum describing the different kinds of tokens that the lexer emits.

Values: "!" "$" "&" "(" ")" "..." ":" "<EOF>" "<SOF>" "=" "@" "BlockString" "Comment" "Float" "Int" "Name" "String" "[" "]" "{" "|" "}"
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

line number

The 1-indexed line number on which this Token appears.

column number

The 1-indexed column number at which this Token begins.

value string

For non-punctuation tokens, represents the interpreted value of the token.

Note: is undefined for punctuation tokens, but typed as string for convenience in the parser.

prev object

Represents a range of characters represented by a lexical token within a Source.

next object

Represents a range of characters represented by a lexical token within a Source.

__@toStringTag@38 string
source object

A representation of source input to GraphQL. The name and locationOffset parameters are optional, but they are useful for clients who store GraphQL documents in source files. For example, if the GraphQL input starts at line 40 in a file named Foo.graphql, it might be useful for name to be "Foo.graphql" and location to be { line: 40, column: 1 }. The line and column properties in locationOffset are 1-indexed.

4 nested properties
body string
name string
locationOffset object
__@toStringTag@38 string
__@toStringTag@38 string

Type Reference

Kind.LIST_TYPE string
NonNullTypeNode object
kind string
Values: "NonNullType"
loc object

Contains a range of UTF-8 character offsets and token references that identify the region of the source from which the AST derived.

6 nested properties
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

startToken object

Represents a range of characters represented by a lexical token within a Source.

9 nested properties
kind string

An exported enum describing the different kinds of tokens that the lexer emits.

Values: "!" "$" "&" "(" ")" "..." ":" "<EOF>" "<SOF>" "=" "@" "BlockString" "Comment" "Float" "Int" "Name" "String" "[" "]" "{" "|" "}"
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

line number

The 1-indexed line number on which this Token appears.

column number

The 1-indexed column number at which this Token begins.

value string

For non-punctuation tokens, represents the interpreted value of the token.

Note: is undefined for punctuation tokens, but typed as string for convenience in the parser.

prev object

Represents a range of characters represented by a lexical token within a Source.

next object

Represents a range of characters represented by a lexical token within a Source.

__@toStringTag@38 string
endToken object

Represents a range of characters represented by a lexical token within a Source.

9 nested properties
kind string

An exported enum describing the different kinds of tokens that the lexer emits.

Values: "!" "$" "&" "(" ")" "..." ":" "<EOF>" "<SOF>" "=" "@" "BlockString" "Comment" "Float" "Int" "Name" "String" "[" "]" "{" "|" "}"
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

line number

The 1-indexed line number on which this Token appears.

column number

The 1-indexed column number at which this Token begins.

value string

For non-punctuation tokens, represents the interpreted value of the token.

Note: is undefined for punctuation tokens, but typed as string for convenience in the parser.

prev object

Represents a range of characters represented by a lexical token within a Source.

next object

Represents a range of characters represented by a lexical token within a Source.

__@toStringTag@38 string
source object

A representation of source input to GraphQL. The name and locationOffset parameters are optional, but they are useful for clients who store GraphQL documents in source files. For example, if the GraphQL input starts at line 40 in a file named Foo.graphql, it might be useful for name to be "Foo.graphql" and location to be { line: 40, column: 1 }. The line and column properties in locationOffset are 1-indexed.

4 nested properties
body string
name string
locationOffset object
__@toStringTag@38 string
__@toStringTag@38 string
Kind.NON_NULL_TYPE string
ReadonlyArray_9 DirectiveNode[]
DirectiveNode object

Directives

kind string

Directives

Values: "Directive"
loc object

Contains a range of UTF-8 character offsets and token references that identify the region of the source from which the AST derived.

6 nested properties
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

startToken object

Represents a range of characters represented by a lexical token within a Source.

9 nested properties
kind string

An exported enum describing the different kinds of tokens that the lexer emits.

Values: "!" "$" "&" "(" ")" "..." ":" "<EOF>" "<SOF>" "=" "@" "BlockString" "Comment" "Float" "Int" "Name" "String" "[" "]" "{" "|" "}"
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

line number

The 1-indexed line number on which this Token appears.

column number

The 1-indexed column number at which this Token begins.

value string

For non-punctuation tokens, represents the interpreted value of the token.

Note: is undefined for punctuation tokens, but typed as string for convenience in the parser.

prev object

Represents a range of characters represented by a lexical token within a Source.

next object

Represents a range of characters represented by a lexical token within a Source.

__@toStringTag@38 string
endToken object

Represents a range of characters represented by a lexical token within a Source.

9 nested properties
kind string

An exported enum describing the different kinds of tokens that the lexer emits.

Values: "!" "$" "&" "(" ")" "..." ":" "<EOF>" "<SOF>" "=" "@" "BlockString" "Comment" "Float" "Int" "Name" "String" "[" "]" "{" "|" "}"
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

line number

The 1-indexed line number on which this Token appears.

column number

The 1-indexed column number at which this Token begins.

value string

For non-punctuation tokens, represents the interpreted value of the token.

Note: is undefined for punctuation tokens, but typed as string for convenience in the parser.

prev object

Represents a range of characters represented by a lexical token within a Source.

next object

Represents a range of characters represented by a lexical token within a Source.

__@toStringTag@38 string
source object

A representation of source input to GraphQL. The name and locationOffset parameters are optional, but they are useful for clients who store GraphQL documents in source files. For example, if the GraphQL input starts at line 40 in a file named Foo.graphql, it might be useful for name to be "Foo.graphql" and location to be { line: 40, column: 1 }. The line and column properties in locationOffset are 1-indexed.

4 nested properties
body string
name string
locationOffset object
__@toStringTag@38 string
__@toStringTag@38 string
name object

Name

3 nested properties
kind string

Name

Values: "Name"
loc object

Contains a range of UTF-8 character offsets and token references that identify the region of the source from which the AST derived.

6 nested properties
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

startToken object

Represents a range of characters represented by a lexical token within a Source.

endToken object

Represents a range of characters represented by a lexical token within a Source.

source object

A representation of source input to GraphQL. The name and locationOffset parameters are optional, but they are useful for clients who store GraphQL documents in source files. For example, if the GraphQL input starts at line 40 in a file named Foo.graphql, it might be useful for name to be "Foo.graphql" and location to be { line: 40, column: 1 }. The line and column properties in locationOffset are 1-indexed.

__@toStringTag@38 string
value string
arguments ArgumentNode[]
ReadonlyArray_10 ArgumentNode[]
ArgumentNode object
kind string
Values: "Argument"
loc object

Contains a range of UTF-8 character offsets and token references that identify the region of the source from which the AST derived.

6 nested properties
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

startToken object

Represents a range of characters represented by a lexical token within a Source.

9 nested properties
kind string

An exported enum describing the different kinds of tokens that the lexer emits.

Values: "!" "$" "&" "(" ")" "..." ":" "<EOF>" "<SOF>" "=" "@" "BlockString" "Comment" "Float" "Int" "Name" "String" "[" "]" "{" "|" "}"
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

line number

The 1-indexed line number on which this Token appears.

column number

The 1-indexed column number at which this Token begins.

value string

For non-punctuation tokens, represents the interpreted value of the token.

Note: is undefined for punctuation tokens, but typed as string for convenience in the parser.

prev object

Represents a range of characters represented by a lexical token within a Source.

next object

Represents a range of characters represented by a lexical token within a Source.

__@toStringTag@38 string
endToken object

Represents a range of characters represented by a lexical token within a Source.

9 nested properties
kind string

An exported enum describing the different kinds of tokens that the lexer emits.

Values: "!" "$" "&" "(" ")" "..." ":" "<EOF>" "<SOF>" "=" "@" "BlockString" "Comment" "Float" "Int" "Name" "String" "[" "]" "{" "|" "}"
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

line number

The 1-indexed line number on which this Token appears.

column number

The 1-indexed column number at which this Token begins.

value string

For non-punctuation tokens, represents the interpreted value of the token.

Note: is undefined for punctuation tokens, but typed as string for convenience in the parser.

prev object

Represents a range of characters represented by a lexical token within a Source.

next object

Represents a range of characters represented by a lexical token within a Source.

__@toStringTag@38 string
source object

A representation of source input to GraphQL. The name and locationOffset parameters are optional, but they are useful for clients who store GraphQL documents in source files. For example, if the GraphQL input starts at line 40 in a file named Foo.graphql, it might be useful for name to be "Foo.graphql" and location to be { line: 40, column: 1 }. The line and column properties in locationOffset are 1-indexed.

4 nested properties
body string
name string
locationOffset object
__@toStringTag@38 string
__@toStringTag@38 string
name object

Name

3 nested properties
kind string

Name

Values: "Name"
loc object

Contains a range of UTF-8 character offsets and token references that identify the region of the source from which the AST derived.

6 nested properties
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

startToken object

Represents a range of characters represented by a lexical token within a Source.

endToken object

Represents a range of characters represented by a lexical token within a Source.

source object

A representation of source input to GraphQL. The name and locationOffset parameters are optional, but they are useful for clients who store GraphQL documents in source files. For example, if the GraphQL input starts at line 40 in a file named Foo.graphql, it might be useful for name to be "Foo.graphql" and location to be { line: 40, column: 1 }. The line and column properties in locationOffset are 1-indexed.

__@toStringTag@38 string
value string
ValueNode VariableNode | IntValueNode | FloatValueNode | StringValueNode | BooleanValueNode | NullValueNode | EnumValueNode | ListValueNode | ObjectValueNode

Values

ListValueNode object
kind string
Values: "ListValue"
loc object

Contains a range of UTF-8 character offsets and token references that identify the region of the source from which the AST derived.

6 nested properties
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

startToken object

Represents a range of characters represented by a lexical token within a Source.

9 nested properties
kind string

An exported enum describing the different kinds of tokens that the lexer emits.

Values: "!" "$" "&" "(" ")" "..." ":" "<EOF>" "<SOF>" "=" "@" "BlockString" "Comment" "Float" "Int" "Name" "String" "[" "]" "{" "|" "}"
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

line number

The 1-indexed line number on which this Token appears.

column number

The 1-indexed column number at which this Token begins.

value string

For non-punctuation tokens, represents the interpreted value of the token.

Note: is undefined for punctuation tokens, but typed as string for convenience in the parser.

prev object

Represents a range of characters represented by a lexical token within a Source.

next object

Represents a range of characters represented by a lexical token within a Source.

__@toStringTag@38 string
endToken object

Represents a range of characters represented by a lexical token within a Source.

9 nested properties
kind string

An exported enum describing the different kinds of tokens that the lexer emits.

Values: "!" "$" "&" "(" ")" "..." ":" "<EOF>" "<SOF>" "=" "@" "BlockString" "Comment" "Float" "Int" "Name" "String" "[" "]" "{" "|" "}"
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

line number

The 1-indexed line number on which this Token appears.

column number

The 1-indexed column number at which this Token begins.

value string

For non-punctuation tokens, represents the interpreted value of the token.

Note: is undefined for punctuation tokens, but typed as string for convenience in the parser.

prev object

Represents a range of characters represented by a lexical token within a Source.

next object

Represents a range of characters represented by a lexical token within a Source.

__@toStringTag@38 string
source object

A representation of source input to GraphQL. The name and locationOffset parameters are optional, but they are useful for clients who store GraphQL documents in source files. For example, if the GraphQL input starts at line 40 in a file named Foo.graphql, it might be useful for name to be "Foo.graphql" and location to be { line: 40, column: 1 }. The line and column properties in locationOffset are 1-indexed.

4 nested properties
body string
name string
locationOffset object
__@toStringTag@38 string
__@toStringTag@38 string
values ValueNode[]
ReadonlyArray_11 ValueNode[]
ObjectValueNode object
kind string
Values: "ObjectValue"
loc object

Contains a range of UTF-8 character offsets and token references that identify the region of the source from which the AST derived.

6 nested properties
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

startToken object

Represents a range of characters represented by a lexical token within a Source.

9 nested properties
kind string

An exported enum describing the different kinds of tokens that the lexer emits.

Values: "!" "$" "&" "(" ")" "..." ":" "<EOF>" "<SOF>" "=" "@" "BlockString" "Comment" "Float" "Int" "Name" "String" "[" "]" "{" "|" "}"
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

line number

The 1-indexed line number on which this Token appears.

column number

The 1-indexed column number at which this Token begins.

value string

For non-punctuation tokens, represents the interpreted value of the token.

Note: is undefined for punctuation tokens, but typed as string for convenience in the parser.

prev object

Represents a range of characters represented by a lexical token within a Source.

next object

Represents a range of characters represented by a lexical token within a Source.

__@toStringTag@38 string
endToken object

Represents a range of characters represented by a lexical token within a Source.

9 nested properties
kind string

An exported enum describing the different kinds of tokens that the lexer emits.

Values: "!" "$" "&" "(" ")" "..." ":" "<EOF>" "<SOF>" "=" "@" "BlockString" "Comment" "Float" "Int" "Name" "String" "[" "]" "{" "|" "}"
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

line number

The 1-indexed line number on which this Token appears.

column number

The 1-indexed column number at which this Token begins.

value string

For non-punctuation tokens, represents the interpreted value of the token.

Note: is undefined for punctuation tokens, but typed as string for convenience in the parser.

prev object

Represents a range of characters represented by a lexical token within a Source.

next object

Represents a range of characters represented by a lexical token within a Source.

__@toStringTag@38 string
source object

A representation of source input to GraphQL. The name and locationOffset parameters are optional, but they are useful for clients who store GraphQL documents in source files. For example, if the GraphQL input starts at line 40 in a file named Foo.graphql, it might be useful for name to be "Foo.graphql" and location to be { line: 40, column: 1 }. The line and column properties in locationOffset are 1-indexed.

4 nested properties
body string
name string
locationOffset object
__@toStringTag@38 string
__@toStringTag@38 string
ReadonlyArray_12 ObjectFieldNode[]
ObjectFieldNode object
kind string
Values: "ObjectField"
loc object

Contains a range of UTF-8 character offsets and token references that identify the region of the source from which the AST derived.

6 nested properties
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

startToken object

Represents a range of characters represented by a lexical token within a Source.

9 nested properties
kind string

An exported enum describing the different kinds of tokens that the lexer emits.

Values: "!" "$" "&" "(" ")" "..." ":" "<EOF>" "<SOF>" "=" "@" "BlockString" "Comment" "Float" "Int" "Name" "String" "[" "]" "{" "|" "}"
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

line number

The 1-indexed line number on which this Token appears.

column number

The 1-indexed column number at which this Token begins.

value string

For non-punctuation tokens, represents the interpreted value of the token.

Note: is undefined for punctuation tokens, but typed as string for convenience in the parser.

prev object

Represents a range of characters represented by a lexical token within a Source.

next object

Represents a range of characters represented by a lexical token within a Source.

__@toStringTag@38 string
endToken object

Represents a range of characters represented by a lexical token within a Source.

9 nested properties
kind string

An exported enum describing the different kinds of tokens that the lexer emits.

Values: "!" "$" "&" "(" ")" "..." ":" "<EOF>" "<SOF>" "=" "@" "BlockString" "Comment" "Float" "Int" "Name" "String" "[" "]" "{" "|" "}"
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

line number

The 1-indexed line number on which this Token appears.

column number

The 1-indexed column number at which this Token begins.

value string

For non-punctuation tokens, represents the interpreted value of the token.

Note: is undefined for punctuation tokens, but typed as string for convenience in the parser.

prev object

Represents a range of characters represented by a lexical token within a Source.

next object

Represents a range of characters represented by a lexical token within a Source.

__@toStringTag@38 string
source object

A representation of source input to GraphQL. The name and locationOffset parameters are optional, but they are useful for clients who store GraphQL documents in source files. For example, if the GraphQL input starts at line 40 in a file named Foo.graphql, it might be useful for name to be "Foo.graphql" and location to be { line: 40, column: 1 }. The line and column properties in locationOffset are 1-indexed.

4 nested properties
body string
name string
locationOffset object
__@toStringTag@38 string
__@toStringTag@38 string
name object

Name

3 nested properties
kind string

Name

Values: "Name"
loc object

Contains a range of UTF-8 character offsets and token references that identify the region of the source from which the AST derived.

6 nested properties
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

startToken object

Represents a range of characters represented by a lexical token within a Source.

endToken object

Represents a range of characters represented by a lexical token within a Source.

source object

A representation of source input to GraphQL. The name and locationOffset parameters are optional, but they are useful for clients who store GraphQL documents in source files. For example, if the GraphQL input starts at line 40 in a file named Foo.graphql, it might be useful for name to be "Foo.graphql" and location to be { line: 40, column: 1 }. The line and column properties in locationOffset are 1-indexed.

__@toStringTag@38 string
value string
SelectionSetNode object
kind string
Values: "SelectionSet"
loc object

Contains a range of UTF-8 character offsets and token references that identify the region of the source from which the AST derived.

6 nested properties
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

startToken object

Represents a range of characters represented by a lexical token within a Source.

9 nested properties
kind string

An exported enum describing the different kinds of tokens that the lexer emits.

Values: "!" "$" "&" "(" ")" "..." ":" "<EOF>" "<SOF>" "=" "@" "BlockString" "Comment" "Float" "Int" "Name" "String" "[" "]" "{" "|" "}"
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

line number

The 1-indexed line number on which this Token appears.

column number

The 1-indexed column number at which this Token begins.

value string

For non-punctuation tokens, represents the interpreted value of the token.

Note: is undefined for punctuation tokens, but typed as string for convenience in the parser.

prev object

Represents a range of characters represented by a lexical token within a Source.

next object

Represents a range of characters represented by a lexical token within a Source.

__@toStringTag@38 string
endToken object

Represents a range of characters represented by a lexical token within a Source.

9 nested properties
kind string

An exported enum describing the different kinds of tokens that the lexer emits.

Values: "!" "$" "&" "(" ")" "..." ":" "<EOF>" "<SOF>" "=" "@" "BlockString" "Comment" "Float" "Int" "Name" "String" "[" "]" "{" "|" "}"
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

line number

The 1-indexed line number on which this Token appears.

column number

The 1-indexed column number at which this Token begins.

value string

For non-punctuation tokens, represents the interpreted value of the token.

Note: is undefined for punctuation tokens, but typed as string for convenience in the parser.

prev object

Represents a range of characters represented by a lexical token within a Source.

next object

Represents a range of characters represented by a lexical token within a Source.

__@toStringTag@38 string
source object

A representation of source input to GraphQL. The name and locationOffset parameters are optional, but they are useful for clients who store GraphQL documents in source files. For example, if the GraphQL input starts at line 40 in a file named Foo.graphql, it might be useful for name to be "Foo.graphql" and location to be { line: 40, column: 1 }. The line and column properties in locationOffset are 1-indexed.

4 nested properties
body string
name string
locationOffset object
__@toStringTag@38 string
__@toStringTag@38 string
selections SelectionNode[]
Kind.SELECTION_SET string
ReadonlyArray_13 SelectionNode[]
SelectionNode FieldNode | FragmentSpreadNode | InlineFragmentNode
FieldNode object
kind string
Values: "Field"
loc object

Contains a range of UTF-8 character offsets and token references that identify the region of the source from which the AST derived.

6 nested properties
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

startToken object

Represents a range of characters represented by a lexical token within a Source.

9 nested properties
kind string

An exported enum describing the different kinds of tokens that the lexer emits.

Values: "!" "$" "&" "(" ")" "..." ":" "<EOF>" "<SOF>" "=" "@" "BlockString" "Comment" "Float" "Int" "Name" "String" "[" "]" "{" "|" "}"
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

line number

The 1-indexed line number on which this Token appears.

column number

The 1-indexed column number at which this Token begins.

value string

For non-punctuation tokens, represents the interpreted value of the token.

Note: is undefined for punctuation tokens, but typed as string for convenience in the parser.

prev object

Represents a range of characters represented by a lexical token within a Source.

next object

Represents a range of characters represented by a lexical token within a Source.

__@toStringTag@38 string
endToken object

Represents a range of characters represented by a lexical token within a Source.

9 nested properties
kind string

An exported enum describing the different kinds of tokens that the lexer emits.

Values: "!" "$" "&" "(" ")" "..." ":" "<EOF>" "<SOF>" "=" "@" "BlockString" "Comment" "Float" "Int" "Name" "String" "[" "]" "{" "|" "}"
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

line number

The 1-indexed line number on which this Token appears.

column number

The 1-indexed column number at which this Token begins.

value string

For non-punctuation tokens, represents the interpreted value of the token.

Note: is undefined for punctuation tokens, but typed as string for convenience in the parser.

prev object

Represents a range of characters represented by a lexical token within a Source.

next object

Represents a range of characters represented by a lexical token within a Source.

__@toStringTag@38 string
source object

A representation of source input to GraphQL. The name and locationOffset parameters are optional, but they are useful for clients who store GraphQL documents in source files. For example, if the GraphQL input starts at line 40 in a file named Foo.graphql, it might be useful for name to be "Foo.graphql" and location to be { line: 40, column: 1 }. The line and column properties in locationOffset are 1-indexed.

4 nested properties
body string
name string
locationOffset object
__@toStringTag@38 string
__@toStringTag@38 string
alias object

Name

3 nested properties
kind string

Name

Values: "Name"
loc object

Contains a range of UTF-8 character offsets and token references that identify the region of the source from which the AST derived.

6 nested properties
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

startToken object

Represents a range of characters represented by a lexical token within a Source.

endToken object

Represents a range of characters represented by a lexical token within a Source.

source object

A representation of source input to GraphQL. The name and locationOffset parameters are optional, but they are useful for clients who store GraphQL documents in source files. For example, if the GraphQL input starts at line 40 in a file named Foo.graphql, it might be useful for name to be "Foo.graphql" and location to be { line: 40, column: 1 }. The line and column properties in locationOffset are 1-indexed.

__@toStringTag@38 string
value string
name object

Name

3 nested properties
kind string

Name

Values: "Name"
loc object

Contains a range of UTF-8 character offsets and token references that identify the region of the source from which the AST derived.

6 nested properties
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

startToken object

Represents a range of characters represented by a lexical token within a Source.

endToken object

Represents a range of characters represented by a lexical token within a Source.

source object

A representation of source input to GraphQL. The name and locationOffset parameters are optional, but they are useful for clients who store GraphQL documents in source files. For example, if the GraphQL input starts at line 40 in a file named Foo.graphql, it might be useful for name to be "Foo.graphql" and location to be { line: 40, column: 1 }. The line and column properties in locationOffset are 1-indexed.

__@toStringTag@38 string
value string
arguments ArgumentNode[]
directives DirectiveNode[]
selectionSet object
3 nested properties
kind string
Values: "SelectionSet"
loc object

Contains a range of UTF-8 character offsets and token references that identify the region of the source from which the AST derived.

6 nested properties
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

startToken object

Represents a range of characters represented by a lexical token within a Source.

endToken object

Represents a range of characters represented by a lexical token within a Source.

source object

A representation of source input to GraphQL. The name and locationOffset parameters are optional, but they are useful for clients who store GraphQL documents in source files. For example, if the GraphQL input starts at line 40 in a file named Foo.graphql, it might be useful for name to be "Foo.graphql" and location to be { line: 40, column: 1 }. The line and column properties in locationOffset are 1-indexed.

__@toStringTag@38 string
selections SelectionNode[]
Kind.FIELD string
FragmentSpreadNode object

Fragments

kind string

Fragments

Values: "FragmentSpread"
loc object

Contains a range of UTF-8 character offsets and token references that identify the region of the source from which the AST derived.

6 nested properties
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

startToken object

Represents a range of characters represented by a lexical token within a Source.

9 nested properties
kind string

An exported enum describing the different kinds of tokens that the lexer emits.

Values: "!" "$" "&" "(" ")" "..." ":" "<EOF>" "<SOF>" "=" "@" "BlockString" "Comment" "Float" "Int" "Name" "String" "[" "]" "{" "|" "}"
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

line number

The 1-indexed line number on which this Token appears.

column number

The 1-indexed column number at which this Token begins.

value string

For non-punctuation tokens, represents the interpreted value of the token.

Note: is undefined for punctuation tokens, but typed as string for convenience in the parser.

prev object

Represents a range of characters represented by a lexical token within a Source.

next object

Represents a range of characters represented by a lexical token within a Source.

__@toStringTag@38 string
endToken object

Represents a range of characters represented by a lexical token within a Source.

9 nested properties
kind string

An exported enum describing the different kinds of tokens that the lexer emits.

Values: "!" "$" "&" "(" ")" "..." ":" "<EOF>" "<SOF>" "=" "@" "BlockString" "Comment" "Float" "Int" "Name" "String" "[" "]" "{" "|" "}"
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

line number

The 1-indexed line number on which this Token appears.

column number

The 1-indexed column number at which this Token begins.

value string

For non-punctuation tokens, represents the interpreted value of the token.

Note: is undefined for punctuation tokens, but typed as string for convenience in the parser.

prev object

Represents a range of characters represented by a lexical token within a Source.

next object

Represents a range of characters represented by a lexical token within a Source.

__@toStringTag@38 string
source object

A representation of source input to GraphQL. The name and locationOffset parameters are optional, but they are useful for clients who store GraphQL documents in source files. For example, if the GraphQL input starts at line 40 in a file named Foo.graphql, it might be useful for name to be "Foo.graphql" and location to be { line: 40, column: 1 }. The line and column properties in locationOffset are 1-indexed.

4 nested properties
body string
name string
locationOffset object
__@toStringTag@38 string
__@toStringTag@38 string
name object

Name

3 nested properties
kind string

Name

Values: "Name"
loc object

Contains a range of UTF-8 character offsets and token references that identify the region of the source from which the AST derived.

6 nested properties
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

startToken object

Represents a range of characters represented by a lexical token within a Source.

endToken object

Represents a range of characters represented by a lexical token within a Source.

source object

A representation of source input to GraphQL. The name and locationOffset parameters are optional, but they are useful for clients who store GraphQL documents in source files. For example, if the GraphQL input starts at line 40 in a file named Foo.graphql, it might be useful for name to be "Foo.graphql" and location to be { line: 40, column: 1 }. The line and column properties in locationOffset are 1-indexed.

__@toStringTag@38 string
value string
directives DirectiveNode[]
Kind.FRAGMENT_SPREAD string

Fragments

InlineFragmentNode object
kind string
Values: "InlineFragment"
loc object

Contains a range of UTF-8 character offsets and token references that identify the region of the source from which the AST derived.

6 nested properties
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

startToken object

Represents a range of characters represented by a lexical token within a Source.

9 nested properties
kind string

An exported enum describing the different kinds of tokens that the lexer emits.

Values: "!" "$" "&" "(" ")" "..." ":" "<EOF>" "<SOF>" "=" "@" "BlockString" "Comment" "Float" "Int" "Name" "String" "[" "]" "{" "|" "}"
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

line number

The 1-indexed line number on which this Token appears.

column number

The 1-indexed column number at which this Token begins.

value string

For non-punctuation tokens, represents the interpreted value of the token.

Note: is undefined for punctuation tokens, but typed as string for convenience in the parser.

prev object

Represents a range of characters represented by a lexical token within a Source.

next object

Represents a range of characters represented by a lexical token within a Source.

__@toStringTag@38 string
endToken object

Represents a range of characters represented by a lexical token within a Source.

9 nested properties
kind string

An exported enum describing the different kinds of tokens that the lexer emits.

Values: "!" "$" "&" "(" ")" "..." ":" "<EOF>" "<SOF>" "=" "@" "BlockString" "Comment" "Float" "Int" "Name" "String" "[" "]" "{" "|" "}"
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

line number

The 1-indexed line number on which this Token appears.

column number

The 1-indexed column number at which this Token begins.

value string

For non-punctuation tokens, represents the interpreted value of the token.

Note: is undefined for punctuation tokens, but typed as string for convenience in the parser.

prev object

Represents a range of characters represented by a lexical token within a Source.

next object

Represents a range of characters represented by a lexical token within a Source.

__@toStringTag@38 string
source object

A representation of source input to GraphQL. The name and locationOffset parameters are optional, but they are useful for clients who store GraphQL documents in source files. For example, if the GraphQL input starts at line 40 in a file named Foo.graphql, it might be useful for name to be "Foo.graphql" and location to be { line: 40, column: 1 }. The line and column properties in locationOffset are 1-indexed.

4 nested properties
body string
name string
locationOffset object
__@toStringTag@38 string
__@toStringTag@38 string
typeCondition object
3 nested properties
kind string

Types

Values: "NamedType"
loc object

Contains a range of UTF-8 character offsets and token references that identify the region of the source from which the AST derived.

6 nested properties
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

startToken object

Represents a range of characters represented by a lexical token within a Source.

endToken object

Represents a range of characters represented by a lexical token within a Source.

source object

A representation of source input to GraphQL. The name and locationOffset parameters are optional, but they are useful for clients who store GraphQL documents in source files. For example, if the GraphQL input starts at line 40 in a file named Foo.graphql, it might be useful for name to be "Foo.graphql" and location to be { line: 40, column: 1 }. The line and column properties in locationOffset are 1-indexed.

__@toStringTag@38 string
name object

Name

3 nested properties
kind string

Name

Values: "Name"
loc object

Contains a range of UTF-8 character offsets and token references that identify the region of the source from which the AST derived.

value string
directives DirectiveNode[]
selectionSet object
3 nested properties
kind string
Values: "SelectionSet"
loc object

Contains a range of UTF-8 character offsets and token references that identify the region of the source from which the AST derived.

6 nested properties
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

startToken object

Represents a range of characters represented by a lexical token within a Source.

endToken object

Represents a range of characters represented by a lexical token within a Source.

source object

A representation of source input to GraphQL. The name and locationOffset parameters are optional, but they are useful for clients who store GraphQL documents in source files. For example, if the GraphQL input starts at line 40 in a file named Foo.graphql, it might be useful for name to be "Foo.graphql" and location to be { line: 40, column: 1 }. The line and column properties in locationOffset are 1-indexed.

__@toStringTag@38 string
selections SelectionNode[]
Kind.INLINE_FRAGMENT string
FragmentDefinitionNode object
kind string
Values: "FragmentDefinition"
loc object

Contains a range of UTF-8 character offsets and token references that identify the region of the source from which the AST derived.

6 nested properties
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

startToken object

Represents a range of characters represented by a lexical token within a Source.

9 nested properties
kind string

An exported enum describing the different kinds of tokens that the lexer emits.

Values: "!" "$" "&" "(" ")" "..." ":" "<EOF>" "<SOF>" "=" "@" "BlockString" "Comment" "Float" "Int" "Name" "String" "[" "]" "{" "|" "}"
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

line number

The 1-indexed line number on which this Token appears.

column number

The 1-indexed column number at which this Token begins.

value string

For non-punctuation tokens, represents the interpreted value of the token.

Note: is undefined for punctuation tokens, but typed as string for convenience in the parser.

prev object

Represents a range of characters represented by a lexical token within a Source.

next object

Represents a range of characters represented by a lexical token within a Source.

__@toStringTag@38 string
endToken object

Represents a range of characters represented by a lexical token within a Source.

9 nested properties
kind string

An exported enum describing the different kinds of tokens that the lexer emits.

Values: "!" "$" "&" "(" ")" "..." ":" "<EOF>" "<SOF>" "=" "@" "BlockString" "Comment" "Float" "Int" "Name" "String" "[" "]" "{" "|" "}"
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

line number

The 1-indexed line number on which this Token appears.

column number

The 1-indexed column number at which this Token begins.

value string

For non-punctuation tokens, represents the interpreted value of the token.

Note: is undefined for punctuation tokens, but typed as string for convenience in the parser.

prev object

Represents a range of characters represented by a lexical token within a Source.

next object

Represents a range of characters represented by a lexical token within a Source.

__@toStringTag@38 string
source object

A representation of source input to GraphQL. The name and locationOffset parameters are optional, but they are useful for clients who store GraphQL documents in source files. For example, if the GraphQL input starts at line 40 in a file named Foo.graphql, it might be useful for name to be "Foo.graphql" and location to be { line: 40, column: 1 }. The line and column properties in locationOffset are 1-indexed.

4 nested properties
body string
name string
locationOffset object
__@toStringTag@38 string
__@toStringTag@38 string
name object

Name

3 nested properties
kind string

Name

Values: "Name"
loc object

Contains a range of UTF-8 character offsets and token references that identify the region of the source from which the AST derived.

6 nested properties
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

startToken object

Represents a range of characters represented by a lexical token within a Source.

endToken object

Represents a range of characters represented by a lexical token within a Source.

source object

A representation of source input to GraphQL. The name and locationOffset parameters are optional, but they are useful for clients who store GraphQL documents in source files. For example, if the GraphQL input starts at line 40 in a file named Foo.graphql, it might be useful for name to be "Foo.graphql" and location to be { line: 40, column: 1 }. The line and column properties in locationOffset are 1-indexed.

__@toStringTag@38 string
value string
variableDefinitions VariableDefinitionNode[]
typeCondition object
3 nested properties
kind string

Types

Values: "NamedType"
loc object

Contains a range of UTF-8 character offsets and token references that identify the region of the source from which the AST derived.

6 nested properties
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

startToken object

Represents a range of characters represented by a lexical token within a Source.

endToken object

Represents a range of characters represented by a lexical token within a Source.

source object

A representation of source input to GraphQL. The name and locationOffset parameters are optional, but they are useful for clients who store GraphQL documents in source files. For example, if the GraphQL input starts at line 40 in a file named Foo.graphql, it might be useful for name to be "Foo.graphql" and location to be { line: 40, column: 1 }. The line and column properties in locationOffset are 1-indexed.

__@toStringTag@38 string
name object

Name

3 nested properties
kind string

Name

Values: "Name"
loc object

Contains a range of UTF-8 character offsets and token references that identify the region of the source from which the AST derived.

value string
directives DirectiveNode[]
selectionSet object
3 nested properties
kind string
Values: "SelectionSet"
loc object

Contains a range of UTF-8 character offsets and token references that identify the region of the source from which the AST derived.

6 nested properties
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

startToken object

Represents a range of characters represented by a lexical token within a Source.

endToken object

Represents a range of characters represented by a lexical token within a Source.

source object

A representation of source input to GraphQL. The name and locationOffset parameters are optional, but they are useful for clients who store GraphQL documents in source files. For example, if the GraphQL input starts at line 40 in a file named Foo.graphql, it might be useful for name to be "Foo.graphql" and location to be { line: 40, column: 1 }. The line and column properties in locationOffset are 1-indexed.

__@toStringTag@38 string
selections SelectionNode[]
Kind.FRAGMENT_DEFINITION string
ScalarTypeDefinitionNode object
kind string

Type Definitions

Values: "ScalarTypeDefinition"
loc object

Contains a range of UTF-8 character offsets and token references that identify the region of the source from which the AST derived.

6 nested properties
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

startToken object

Represents a range of characters represented by a lexical token within a Source.

9 nested properties
kind string

An exported enum describing the different kinds of tokens that the lexer emits.

Values: "!" "$" "&" "(" ")" "..." ":" "<EOF>" "<SOF>" "=" "@" "BlockString" "Comment" "Float" "Int" "Name" "String" "[" "]" "{" "|" "}"
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

line number

The 1-indexed line number on which this Token appears.

column number

The 1-indexed column number at which this Token begins.

value string

For non-punctuation tokens, represents the interpreted value of the token.

Note: is undefined for punctuation tokens, but typed as string for convenience in the parser.

prev object

Represents a range of characters represented by a lexical token within a Source.

next object

Represents a range of characters represented by a lexical token within a Source.

__@toStringTag@38 string
endToken object

Represents a range of characters represented by a lexical token within a Source.

9 nested properties
kind string

An exported enum describing the different kinds of tokens that the lexer emits.

Values: "!" "$" "&" "(" ")" "..." ":" "<EOF>" "<SOF>" "=" "@" "BlockString" "Comment" "Float" "Int" "Name" "String" "[" "]" "{" "|" "}"
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

line number

The 1-indexed line number on which this Token appears.

column number

The 1-indexed column number at which this Token begins.

value string

For non-punctuation tokens, represents the interpreted value of the token.

Note: is undefined for punctuation tokens, but typed as string for convenience in the parser.

prev object

Represents a range of characters represented by a lexical token within a Source.

next object

Represents a range of characters represented by a lexical token within a Source.

__@toStringTag@38 string
source object

A representation of source input to GraphQL. The name and locationOffset parameters are optional, but they are useful for clients who store GraphQL documents in source files. For example, if the GraphQL input starts at line 40 in a file named Foo.graphql, it might be useful for name to be "Foo.graphql" and location to be { line: 40, column: 1 }. The line and column properties in locationOffset are 1-indexed.

4 nested properties
body string
name string
locationOffset object
__@toStringTag@38 string
__@toStringTag@38 string
description object
4 nested properties
kind string
Values: "StringValue"
loc object

Contains a range of UTF-8 character offsets and token references that identify the region of the source from which the AST derived.

6 nested properties
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

startToken object

Represents a range of characters represented by a lexical token within a Source.

endToken object

Represents a range of characters represented by a lexical token within a Source.

source object

A representation of source input to GraphQL. The name and locationOffset parameters are optional, but they are useful for clients who store GraphQL documents in source files. For example, if the GraphQL input starts at line 40 in a file named Foo.graphql, it might be useful for name to be "Foo.graphql" and location to be { line: 40, column: 1 }. The line and column properties in locationOffset are 1-indexed.

__@toStringTag@38 string
value string
block boolean
name object

Name

3 nested properties
kind string

Name

Values: "Name"
loc object

Contains a range of UTF-8 character offsets and token references that identify the region of the source from which the AST derived.

6 nested properties
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

startToken object

Represents a range of characters represented by a lexical token within a Source.

endToken object

Represents a range of characters represented by a lexical token within a Source.

source object

A representation of source input to GraphQL. The name and locationOffset parameters are optional, but they are useful for clients who store GraphQL documents in source files. For example, if the GraphQL input starts at line 40 in a file named Foo.graphql, it might be useful for name to be "Foo.graphql" and location to be { line: 40, column: 1 }. The line and column properties in locationOffset are 1-indexed.

__@toStringTag@38 string
value string
Kind.SCALAR_TYPE_DEFINITION string

Type Definitions

ObjectTypeDefinitionNode object
kind string
Values: "ObjectTypeDefinition"
loc object

Contains a range of UTF-8 character offsets and token references that identify the region of the source from which the AST derived.

6 nested properties
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

startToken object

Represents a range of characters represented by a lexical token within a Source.

9 nested properties
kind string

An exported enum describing the different kinds of tokens that the lexer emits.

Values: "!" "$" "&" "(" ")" "..." ":" "<EOF>" "<SOF>" "=" "@" "BlockString" "Comment" "Float" "Int" "Name" "String" "[" "]" "{" "|" "}"
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

line number

The 1-indexed line number on which this Token appears.

column number

The 1-indexed column number at which this Token begins.

value string

For non-punctuation tokens, represents the interpreted value of the token.

Note: is undefined for punctuation tokens, but typed as string for convenience in the parser.

prev object

Represents a range of characters represented by a lexical token within a Source.

next object

Represents a range of characters represented by a lexical token within a Source.

__@toStringTag@38 string
endToken object

Represents a range of characters represented by a lexical token within a Source.

9 nested properties
kind string

An exported enum describing the different kinds of tokens that the lexer emits.

Values: "!" "$" "&" "(" ")" "..." ":" "<EOF>" "<SOF>" "=" "@" "BlockString" "Comment" "Float" "Int" "Name" "String" "[" "]" "{" "|" "}"
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

line number

The 1-indexed line number on which this Token appears.

column number

The 1-indexed column number at which this Token begins.

value string

For non-punctuation tokens, represents the interpreted value of the token.

Note: is undefined for punctuation tokens, but typed as string for convenience in the parser.

prev object

Represents a range of characters represented by a lexical token within a Source.

next object

Represents a range of characters represented by a lexical token within a Source.

__@toStringTag@38 string
source object

A representation of source input to GraphQL. The name and locationOffset parameters are optional, but they are useful for clients who store GraphQL documents in source files. For example, if the GraphQL input starts at line 40 in a file named Foo.graphql, it might be useful for name to be "Foo.graphql" and location to be { line: 40, column: 1 }. The line and column properties in locationOffset are 1-indexed.

4 nested properties
body string
name string
locationOffset object
__@toStringTag@38 string
__@toStringTag@38 string
description object
4 nested properties
kind string
Values: "StringValue"
loc object

Contains a range of UTF-8 character offsets and token references that identify the region of the source from which the AST derived.

6 nested properties
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

startToken object

Represents a range of characters represented by a lexical token within a Source.

endToken object

Represents a range of characters represented by a lexical token within a Source.

source object

A representation of source input to GraphQL. The name and locationOffset parameters are optional, but they are useful for clients who store GraphQL documents in source files. For example, if the GraphQL input starts at line 40 in a file named Foo.graphql, it might be useful for name to be "Foo.graphql" and location to be { line: 40, column: 1 }. The line and column properties in locationOffset are 1-indexed.

__@toStringTag@38 string
value string
block boolean
name object

Name

3 nested properties
kind string

Name

Values: "Name"
loc object

Contains a range of UTF-8 character offsets and token references that identify the region of the source from which the AST derived.

6 nested properties
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

startToken object

Represents a range of characters represented by a lexical token within a Source.

endToken object

Represents a range of characters represented by a lexical token within a Source.

source object

A representation of source input to GraphQL. The name and locationOffset parameters are optional, but they are useful for clients who store GraphQL documents in source files. For example, if the GraphQL input starts at line 40 in a file named Foo.graphql, it might be useful for name to be "Foo.graphql" and location to be { line: 40, column: 1 }. The line and column properties in locationOffset are 1-indexed.

__@toStringTag@38 string
value string
interfaces NamedTypeNode[]
Kind.OBJECT_TYPE_DEFINITION string
ReadonlyArray_14 NamedTypeNode[]
ReadonlyArray_15 FieldDefinitionNode[]
FieldDefinitionNode object
kind string
Values: "FieldDefinition"
loc object

Contains a range of UTF-8 character offsets and token references that identify the region of the source from which the AST derived.

6 nested properties
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

startToken object

Represents a range of characters represented by a lexical token within a Source.

9 nested properties
kind string

An exported enum describing the different kinds of tokens that the lexer emits.

Values: "!" "$" "&" "(" ")" "..." ":" "<EOF>" "<SOF>" "=" "@" "BlockString" "Comment" "Float" "Int" "Name" "String" "[" "]" "{" "|" "}"
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

line number

The 1-indexed line number on which this Token appears.

column number

The 1-indexed column number at which this Token begins.

value string

For non-punctuation tokens, represents the interpreted value of the token.

Note: is undefined for punctuation tokens, but typed as string for convenience in the parser.

prev object

Represents a range of characters represented by a lexical token within a Source.

next object

Represents a range of characters represented by a lexical token within a Source.

__@toStringTag@38 string
endToken object

Represents a range of characters represented by a lexical token within a Source.

9 nested properties
kind string

An exported enum describing the different kinds of tokens that the lexer emits.

Values: "!" "$" "&" "(" ")" "..." ":" "<EOF>" "<SOF>" "=" "@" "BlockString" "Comment" "Float" "Int" "Name" "String" "[" "]" "{" "|" "}"
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

line number

The 1-indexed line number on which this Token appears.

column number

The 1-indexed column number at which this Token begins.

value string

For non-punctuation tokens, represents the interpreted value of the token.

Note: is undefined for punctuation tokens, but typed as string for convenience in the parser.

prev object

Represents a range of characters represented by a lexical token within a Source.

next object

Represents a range of characters represented by a lexical token within a Source.

__@toStringTag@38 string
source object

A representation of source input to GraphQL. The name and locationOffset parameters are optional, but they are useful for clients who store GraphQL documents in source files. For example, if the GraphQL input starts at line 40 in a file named Foo.graphql, it might be useful for name to be "Foo.graphql" and location to be { line: 40, column: 1 }. The line and column properties in locationOffset are 1-indexed.

4 nested properties
body string
name string
locationOffset object
__@toStringTag@38 string
__@toStringTag@38 string
description object
4 nested properties
kind string
Values: "StringValue"
loc object

Contains a range of UTF-8 character offsets and token references that identify the region of the source from which the AST derived.

6 nested properties
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

startToken object

Represents a range of characters represented by a lexical token within a Source.

endToken object

Represents a range of characters represented by a lexical token within a Source.

source object

A representation of source input to GraphQL. The name and locationOffset parameters are optional, but they are useful for clients who store GraphQL documents in source files. For example, if the GraphQL input starts at line 40 in a file named Foo.graphql, it might be useful for name to be "Foo.graphql" and location to be { line: 40, column: 1 }. The line and column properties in locationOffset are 1-indexed.

__@toStringTag@38 string
value string
block boolean
name object

Name

3 nested properties
kind string

Name

Values: "Name"
loc object

Contains a range of UTF-8 character offsets and token references that identify the region of the source from which the AST derived.

6 nested properties
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

startToken object

Represents a range of characters represented by a lexical token within a Source.

endToken object

Represents a range of characters represented by a lexical token within a Source.

source object

A representation of source input to GraphQL. The name and locationOffset parameters are optional, but they are useful for clients who store GraphQL documents in source files. For example, if the GraphQL input starts at line 40 in a file named Foo.graphql, it might be useful for name to be "Foo.graphql" and location to be { line: 40, column: 1 }. The line and column properties in locationOffset are 1-indexed.

__@toStringTag@38 string
value string

Type Reference

Kind.FIELD_DEFINITION string
ReadonlyArray_16 InputValueDefinitionNode[]
InputValueDefinitionNode object
kind string
Values: "InputValueDefinition"
loc object

Contains a range of UTF-8 character offsets and token references that identify the region of the source from which the AST derived.

6 nested properties
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

startToken object

Represents a range of characters represented by a lexical token within a Source.

9 nested properties
kind string

An exported enum describing the different kinds of tokens that the lexer emits.

Values: "!" "$" "&" "(" ")" "..." ":" "<EOF>" "<SOF>" "=" "@" "BlockString" "Comment" "Float" "Int" "Name" "String" "[" "]" "{" "|" "}"
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

line number

The 1-indexed line number on which this Token appears.

column number

The 1-indexed column number at which this Token begins.

value string

For non-punctuation tokens, represents the interpreted value of the token.

Note: is undefined for punctuation tokens, but typed as string for convenience in the parser.

prev object

Represents a range of characters represented by a lexical token within a Source.

next object

Represents a range of characters represented by a lexical token within a Source.

__@toStringTag@38 string
endToken object

Represents a range of characters represented by a lexical token within a Source.

9 nested properties
kind string

An exported enum describing the different kinds of tokens that the lexer emits.

Values: "!" "$" "&" "(" ")" "..." ":" "<EOF>" "<SOF>" "=" "@" "BlockString" "Comment" "Float" "Int" "Name" "String" "[" "]" "{" "|" "}"
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

line number

The 1-indexed line number on which this Token appears.

column number

The 1-indexed column number at which this Token begins.

value string

For non-punctuation tokens, represents the interpreted value of the token.

Note: is undefined for punctuation tokens, but typed as string for convenience in the parser.

prev object

Represents a range of characters represented by a lexical token within a Source.

next object

Represents a range of characters represented by a lexical token within a Source.

__@toStringTag@38 string
source object

A representation of source input to GraphQL. The name and locationOffset parameters are optional, but they are useful for clients who store GraphQL documents in source files. For example, if the GraphQL input starts at line 40 in a file named Foo.graphql, it might be useful for name to be "Foo.graphql" and location to be { line: 40, column: 1 }. The line and column properties in locationOffset are 1-indexed.

4 nested properties
body string
name string
locationOffset object
__@toStringTag@38 string
__@toStringTag@38 string
description object
4 nested properties
kind string
Values: "StringValue"
loc object

Contains a range of UTF-8 character offsets and token references that identify the region of the source from which the AST derived.

6 nested properties
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

startToken object

Represents a range of characters represented by a lexical token within a Source.

endToken object

Represents a range of characters represented by a lexical token within a Source.

source object

A representation of source input to GraphQL. The name and locationOffset parameters are optional, but they are useful for clients who store GraphQL documents in source files. For example, if the GraphQL input starts at line 40 in a file named Foo.graphql, it might be useful for name to be "Foo.graphql" and location to be { line: 40, column: 1 }. The line and column properties in locationOffset are 1-indexed.

__@toStringTag@38 string
value string
block boolean
name object

Name

3 nested properties
kind string

Name

Values: "Name"
loc object

Contains a range of UTF-8 character offsets and token references that identify the region of the source from which the AST derived.

6 nested properties
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

startToken object

Represents a range of characters represented by a lexical token within a Source.

endToken object

Represents a range of characters represented by a lexical token within a Source.

source object

A representation of source input to GraphQL. The name and locationOffset parameters are optional, but they are useful for clients who store GraphQL documents in source files. For example, if the GraphQL input starts at line 40 in a file named Foo.graphql, it might be useful for name to be "Foo.graphql" and location to be { line: 40, column: 1 }. The line and column properties in locationOffset are 1-indexed.

__@toStringTag@38 string
value string

Type Reference

Kind.INPUT_VALUE_DEFINITION string
InterfaceTypeDefinitionNode object
kind string
Values: "InterfaceTypeDefinition"
loc object

Contains a range of UTF-8 character offsets and token references that identify the region of the source from which the AST derived.

6 nested properties
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

startToken object

Represents a range of characters represented by a lexical token within a Source.

9 nested properties
kind string

An exported enum describing the different kinds of tokens that the lexer emits.

Values: "!" "$" "&" "(" ")" "..." ":" "<EOF>" "<SOF>" "=" "@" "BlockString" "Comment" "Float" "Int" "Name" "String" "[" "]" "{" "|" "}"
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

line number

The 1-indexed line number on which this Token appears.

column number

The 1-indexed column number at which this Token begins.

value string

For non-punctuation tokens, represents the interpreted value of the token.

Note: is undefined for punctuation tokens, but typed as string for convenience in the parser.

prev object

Represents a range of characters represented by a lexical token within a Source.

next object

Represents a range of characters represented by a lexical token within a Source.

__@toStringTag@38 string
endToken object

Represents a range of characters represented by a lexical token within a Source.

9 nested properties
kind string

An exported enum describing the different kinds of tokens that the lexer emits.

Values: "!" "$" "&" "(" ")" "..." ":" "<EOF>" "<SOF>" "=" "@" "BlockString" "Comment" "Float" "Int" "Name" "String" "[" "]" "{" "|" "}"
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

line number

The 1-indexed line number on which this Token appears.

column number

The 1-indexed column number at which this Token begins.

value string

For non-punctuation tokens, represents the interpreted value of the token.

Note: is undefined for punctuation tokens, but typed as string for convenience in the parser.

prev object

Represents a range of characters represented by a lexical token within a Source.

next object

Represents a range of characters represented by a lexical token within a Source.

__@toStringTag@38 string
source object

A representation of source input to GraphQL. The name and locationOffset parameters are optional, but they are useful for clients who store GraphQL documents in source files. For example, if the GraphQL input starts at line 40 in a file named Foo.graphql, it might be useful for name to be "Foo.graphql" and location to be { line: 40, column: 1 }. The line and column properties in locationOffset are 1-indexed.

4 nested properties
body string
name string
locationOffset object
__@toStringTag@38 string
__@toStringTag@38 string
description object
4 nested properties
kind string
Values: "StringValue"
loc object

Contains a range of UTF-8 character offsets and token references that identify the region of the source from which the AST derived.

6 nested properties
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

startToken object

Represents a range of characters represented by a lexical token within a Source.

endToken object

Represents a range of characters represented by a lexical token within a Source.

source object

A representation of source input to GraphQL. The name and locationOffset parameters are optional, but they are useful for clients who store GraphQL documents in source files. For example, if the GraphQL input starts at line 40 in a file named Foo.graphql, it might be useful for name to be "Foo.graphql" and location to be { line: 40, column: 1 }. The line and column properties in locationOffset are 1-indexed.

__@toStringTag@38 string
value string
block boolean
name object

Name

3 nested properties
kind string

Name

Values: "Name"
loc object

Contains a range of UTF-8 character offsets and token references that identify the region of the source from which the AST derived.

6 nested properties
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

startToken object

Represents a range of characters represented by a lexical token within a Source.

endToken object

Represents a range of characters represented by a lexical token within a Source.

source object

A representation of source input to GraphQL. The name and locationOffset parameters are optional, but they are useful for clients who store GraphQL documents in source files. For example, if the GraphQL input starts at line 40 in a file named Foo.graphql, it might be useful for name to be "Foo.graphql" and location to be { line: 40, column: 1 }. The line and column properties in locationOffset are 1-indexed.

__@toStringTag@38 string
value string
interfaces NamedTypeNode[]
Kind.INTERFACE_TYPE_DEFINITION string
UnionTypeDefinitionNode object
kind string
Values: "UnionTypeDefinition"
loc object

Contains a range of UTF-8 character offsets and token references that identify the region of the source from which the AST derived.

6 nested properties
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

startToken object

Represents a range of characters represented by a lexical token within a Source.

9 nested properties
kind string

An exported enum describing the different kinds of tokens that the lexer emits.

Values: "!" "$" "&" "(" ")" "..." ":" "<EOF>" "<SOF>" "=" "@" "BlockString" "Comment" "Float" "Int" "Name" "String" "[" "]" "{" "|" "}"
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

line number

The 1-indexed line number on which this Token appears.

column number

The 1-indexed column number at which this Token begins.

value string

For non-punctuation tokens, represents the interpreted value of the token.

Note: is undefined for punctuation tokens, but typed as string for convenience in the parser.

prev object

Represents a range of characters represented by a lexical token within a Source.

next object

Represents a range of characters represented by a lexical token within a Source.

__@toStringTag@38 string
endToken object

Represents a range of characters represented by a lexical token within a Source.

9 nested properties
kind string

An exported enum describing the different kinds of tokens that the lexer emits.

Values: "!" "$" "&" "(" ")" "..." ":" "<EOF>" "<SOF>" "=" "@" "BlockString" "Comment" "Float" "Int" "Name" "String" "[" "]" "{" "|" "}"
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

line number

The 1-indexed line number on which this Token appears.

column number

The 1-indexed column number at which this Token begins.

value string

For non-punctuation tokens, represents the interpreted value of the token.

Note: is undefined for punctuation tokens, but typed as string for convenience in the parser.

prev object

Represents a range of characters represented by a lexical token within a Source.

next object

Represents a range of characters represented by a lexical token within a Source.

__@toStringTag@38 string
source object

A representation of source input to GraphQL. The name and locationOffset parameters are optional, but they are useful for clients who store GraphQL documents in source files. For example, if the GraphQL input starts at line 40 in a file named Foo.graphql, it might be useful for name to be "Foo.graphql" and location to be { line: 40, column: 1 }. The line and column properties in locationOffset are 1-indexed.

4 nested properties
body string
name string
locationOffset object
__@toStringTag@38 string
__@toStringTag@38 string
description object
4 nested properties
kind string
Values: "StringValue"
loc object

Contains a range of UTF-8 character offsets and token references that identify the region of the source from which the AST derived.

6 nested properties
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

startToken object

Represents a range of characters represented by a lexical token within a Source.

endToken object

Represents a range of characters represented by a lexical token within a Source.

source object

A representation of source input to GraphQL. The name and locationOffset parameters are optional, but they are useful for clients who store GraphQL documents in source files. For example, if the GraphQL input starts at line 40 in a file named Foo.graphql, it might be useful for name to be "Foo.graphql" and location to be { line: 40, column: 1 }. The line and column properties in locationOffset are 1-indexed.

__@toStringTag@38 string
value string
block boolean
name object

Name

3 nested properties
kind string

Name

Values: "Name"
loc object

Contains a range of UTF-8 character offsets and token references that identify the region of the source from which the AST derived.

6 nested properties
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

startToken object

Represents a range of characters represented by a lexical token within a Source.

endToken object

Represents a range of characters represented by a lexical token within a Source.

source object

A representation of source input to GraphQL. The name and locationOffset parameters are optional, but they are useful for clients who store GraphQL documents in source files. For example, if the GraphQL input starts at line 40 in a file named Foo.graphql, it might be useful for name to be "Foo.graphql" and location to be { line: 40, column: 1 }. The line and column properties in locationOffset are 1-indexed.

__@toStringTag@38 string
value string
Kind.UNION_TYPE_DEFINITION string
EnumTypeDefinitionNode object
kind string
Values: "EnumTypeDefinition"
loc object

Contains a range of UTF-8 character offsets and token references that identify the region of the source from which the AST derived.

6 nested properties
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

startToken object

Represents a range of characters represented by a lexical token within a Source.

9 nested properties
kind string

An exported enum describing the different kinds of tokens that the lexer emits.

Values: "!" "$" "&" "(" ")" "..." ":" "<EOF>" "<SOF>" "=" "@" "BlockString" "Comment" "Float" "Int" "Name" "String" "[" "]" "{" "|" "}"
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

line number

The 1-indexed line number on which this Token appears.

column number

The 1-indexed column number at which this Token begins.

value string

For non-punctuation tokens, represents the interpreted value of the token.

Note: is undefined for punctuation tokens, but typed as string for convenience in the parser.

prev object

Represents a range of characters represented by a lexical token within a Source.

next object

Represents a range of characters represented by a lexical token within a Source.

__@toStringTag@38 string
endToken object

Represents a range of characters represented by a lexical token within a Source.

9 nested properties
kind string

An exported enum describing the different kinds of tokens that the lexer emits.

Values: "!" "$" "&" "(" ")" "..." ":" "<EOF>" "<SOF>" "=" "@" "BlockString" "Comment" "Float" "Int" "Name" "String" "[" "]" "{" "|" "}"
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

line number

The 1-indexed line number on which this Token appears.

column number

The 1-indexed column number at which this Token begins.

value string

For non-punctuation tokens, represents the interpreted value of the token.

Note: is undefined for punctuation tokens, but typed as string for convenience in the parser.

prev object

Represents a range of characters represented by a lexical token within a Source.

next object

Represents a range of characters represented by a lexical token within a Source.

__@toStringTag@38 string
source object

A representation of source input to GraphQL. The name and locationOffset parameters are optional, but they are useful for clients who store GraphQL documents in source files. For example, if the GraphQL input starts at line 40 in a file named Foo.graphql, it might be useful for name to be "Foo.graphql" and location to be { line: 40, column: 1 }. The line and column properties in locationOffset are 1-indexed.

4 nested properties
body string
name string
locationOffset object
__@toStringTag@38 string
__@toStringTag@38 string
description object
4 nested properties
kind string
Values: "StringValue"
loc object

Contains a range of UTF-8 character offsets and token references that identify the region of the source from which the AST derived.

6 nested properties
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

startToken object

Represents a range of characters represented by a lexical token within a Source.

endToken object

Represents a range of characters represented by a lexical token within a Source.

source object

A representation of source input to GraphQL. The name and locationOffset parameters are optional, but they are useful for clients who store GraphQL documents in source files. For example, if the GraphQL input starts at line 40 in a file named Foo.graphql, it might be useful for name to be "Foo.graphql" and location to be { line: 40, column: 1 }. The line and column properties in locationOffset are 1-indexed.

__@toStringTag@38 string
value string
block boolean
name object

Name

3 nested properties
kind string

Name

Values: "Name"
loc object

Contains a range of UTF-8 character offsets and token references that identify the region of the source from which the AST derived.

6 nested properties
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

startToken object

Represents a range of characters represented by a lexical token within a Source.

endToken object

Represents a range of characters represented by a lexical token within a Source.

source object

A representation of source input to GraphQL. The name and locationOffset parameters are optional, but they are useful for clients who store GraphQL documents in source files. For example, if the GraphQL input starts at line 40 in a file named Foo.graphql, it might be useful for name to be "Foo.graphql" and location to be { line: 40, column: 1 }. The line and column properties in locationOffset are 1-indexed.

__@toStringTag@38 string
value string
Kind.ENUM_TYPE_DEFINITION string
ReadonlyArray_17 EnumValueDefinitionNode[]
EnumValueDefinitionNode object
kind string
Values: "EnumValueDefinition"
loc object

Contains a range of UTF-8 character offsets and token references that identify the region of the source from which the AST derived.

6 nested properties
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

startToken object

Represents a range of characters represented by a lexical token within a Source.

9 nested properties
kind string

An exported enum describing the different kinds of tokens that the lexer emits.

Values: "!" "$" "&" "(" ")" "..." ":" "<EOF>" "<SOF>" "=" "@" "BlockString" "Comment" "Float" "Int" "Name" "String" "[" "]" "{" "|" "}"
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

line number

The 1-indexed line number on which this Token appears.

column number

The 1-indexed column number at which this Token begins.

value string

For non-punctuation tokens, represents the interpreted value of the token.

Note: is undefined for punctuation tokens, but typed as string for convenience in the parser.

prev object

Represents a range of characters represented by a lexical token within a Source.

next object

Represents a range of characters represented by a lexical token within a Source.

__@toStringTag@38 string
endToken object

Represents a range of characters represented by a lexical token within a Source.

9 nested properties
kind string

An exported enum describing the different kinds of tokens that the lexer emits.

Values: "!" "$" "&" "(" ")" "..." ":" "<EOF>" "<SOF>" "=" "@" "BlockString" "Comment" "Float" "Int" "Name" "String" "[" "]" "{" "|" "}"
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

line number

The 1-indexed line number on which this Token appears.

column number

The 1-indexed column number at which this Token begins.

value string

For non-punctuation tokens, represents the interpreted value of the token.

Note: is undefined for punctuation tokens, but typed as string for convenience in the parser.

prev object

Represents a range of characters represented by a lexical token within a Source.

next object

Represents a range of characters represented by a lexical token within a Source.

__@toStringTag@38 string
source object

A representation of source input to GraphQL. The name and locationOffset parameters are optional, but they are useful for clients who store GraphQL documents in source files. For example, if the GraphQL input starts at line 40 in a file named Foo.graphql, it might be useful for name to be "Foo.graphql" and location to be { line: 40, column: 1 }. The line and column properties in locationOffset are 1-indexed.

4 nested properties
body string
name string
locationOffset object
__@toStringTag@38 string
__@toStringTag@38 string
description object
4 nested properties
kind string
Values: "StringValue"
loc object

Contains a range of UTF-8 character offsets and token references that identify the region of the source from which the AST derived.

6 nested properties
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

startToken object

Represents a range of characters represented by a lexical token within a Source.

endToken object

Represents a range of characters represented by a lexical token within a Source.

source object

A representation of source input to GraphQL. The name and locationOffset parameters are optional, but they are useful for clients who store GraphQL documents in source files. For example, if the GraphQL input starts at line 40 in a file named Foo.graphql, it might be useful for name to be "Foo.graphql" and location to be { line: 40, column: 1 }. The line and column properties in locationOffset are 1-indexed.

__@toStringTag@38 string
value string
block boolean
name object

Name

3 nested properties
kind string

Name

Values: "Name"
loc object

Contains a range of UTF-8 character offsets and token references that identify the region of the source from which the AST derived.

6 nested properties
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

startToken object

Represents a range of characters represented by a lexical token within a Source.

endToken object

Represents a range of characters represented by a lexical token within a Source.

source object

A representation of source input to GraphQL. The name and locationOffset parameters are optional, but they are useful for clients who store GraphQL documents in source files. For example, if the GraphQL input starts at line 40 in a file named Foo.graphql, it might be useful for name to be "Foo.graphql" and location to be { line: 40, column: 1 }. The line and column properties in locationOffset are 1-indexed.

__@toStringTag@38 string
value string
Kind.ENUM_VALUE_DEFINITION string
InputObjectTypeDefinitionNode object
kind string
Values: "InputObjectTypeDefinition"
loc object

Contains a range of UTF-8 character offsets and token references that identify the region of the source from which the AST derived.

6 nested properties
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

startToken object

Represents a range of characters represented by a lexical token within a Source.

9 nested properties
kind string

An exported enum describing the different kinds of tokens that the lexer emits.

Values: "!" "$" "&" "(" ")" "..." ":" "<EOF>" "<SOF>" "=" "@" "BlockString" "Comment" "Float" "Int" "Name" "String" "[" "]" "{" "|" "}"
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

line number

The 1-indexed line number on which this Token appears.

column number

The 1-indexed column number at which this Token begins.

value string

For non-punctuation tokens, represents the interpreted value of the token.

Note: is undefined for punctuation tokens, but typed as string for convenience in the parser.

prev object

Represents a range of characters represented by a lexical token within a Source.

next object

Represents a range of characters represented by a lexical token within a Source.

__@toStringTag@38 string
endToken object

Represents a range of characters represented by a lexical token within a Source.

9 nested properties
kind string

An exported enum describing the different kinds of tokens that the lexer emits.

Values: "!" "$" "&" "(" ")" "..." ":" "<EOF>" "<SOF>" "=" "@" "BlockString" "Comment" "Float" "Int" "Name" "String" "[" "]" "{" "|" "}"
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

line number

The 1-indexed line number on which this Token appears.

column number

The 1-indexed column number at which this Token begins.

value string

For non-punctuation tokens, represents the interpreted value of the token.

Note: is undefined for punctuation tokens, but typed as string for convenience in the parser.

prev object

Represents a range of characters represented by a lexical token within a Source.

next object

Represents a range of characters represented by a lexical token within a Source.

__@toStringTag@38 string
source object

A representation of source input to GraphQL. The name and locationOffset parameters are optional, but they are useful for clients who store GraphQL documents in source files. For example, if the GraphQL input starts at line 40 in a file named Foo.graphql, it might be useful for name to be "Foo.graphql" and location to be { line: 40, column: 1 }. The line and column properties in locationOffset are 1-indexed.

4 nested properties
body string
name string
locationOffset object
__@toStringTag@38 string
__@toStringTag@38 string
description object
4 nested properties
kind string
Values: "StringValue"
loc object

Contains a range of UTF-8 character offsets and token references that identify the region of the source from which the AST derived.

6 nested properties
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

startToken object

Represents a range of characters represented by a lexical token within a Source.

endToken object

Represents a range of characters represented by a lexical token within a Source.

source object

A representation of source input to GraphQL. The name and locationOffset parameters are optional, but they are useful for clients who store GraphQL documents in source files. For example, if the GraphQL input starts at line 40 in a file named Foo.graphql, it might be useful for name to be "Foo.graphql" and location to be { line: 40, column: 1 }. The line and column properties in locationOffset are 1-indexed.

__@toStringTag@38 string
value string
block boolean
name object

Name

3 nested properties
kind string

Name

Values: "Name"
loc object

Contains a range of UTF-8 character offsets and token references that identify the region of the source from which the AST derived.

6 nested properties
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

startToken object

Represents a range of characters represented by a lexical token within a Source.

endToken object

Represents a range of characters represented by a lexical token within a Source.

source object

A representation of source input to GraphQL. The name and locationOffset parameters are optional, but they are useful for clients who store GraphQL documents in source files. For example, if the GraphQL input starts at line 40 in a file named Foo.graphql, it might be useful for name to be "Foo.graphql" and location to be { line: 40, column: 1 }. The line and column properties in locationOffset are 1-indexed.

__@toStringTag@38 string
value string
Kind.INPUT_OBJECT_TYPE_DEFINITION string
DirectiveDefinitionNode object

Directive Definitions

kind string

Directive Definitions

Values: "DirectiveDefinition"
loc object

Contains a range of UTF-8 character offsets and token references that identify the region of the source from which the AST derived.

6 nested properties
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

startToken object

Represents a range of characters represented by a lexical token within a Source.

9 nested properties
kind string

An exported enum describing the different kinds of tokens that the lexer emits.

Values: "!" "$" "&" "(" ")" "..." ":" "<EOF>" "<SOF>" "=" "@" "BlockString" "Comment" "Float" "Int" "Name" "String" "[" "]" "{" "|" "}"
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

line number

The 1-indexed line number on which this Token appears.

column number

The 1-indexed column number at which this Token begins.

value string

For non-punctuation tokens, represents the interpreted value of the token.

Note: is undefined for punctuation tokens, but typed as string for convenience in the parser.

prev object

Represents a range of characters represented by a lexical token within a Source.

next object

Represents a range of characters represented by a lexical token within a Source.

__@toStringTag@38 string
endToken object

Represents a range of characters represented by a lexical token within a Source.

9 nested properties
kind string

An exported enum describing the different kinds of tokens that the lexer emits.

Values: "!" "$" "&" "(" ")" "..." ":" "<EOF>" "<SOF>" "=" "@" "BlockString" "Comment" "Float" "Int" "Name" "String" "[" "]" "{" "|" "}"
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

line number

The 1-indexed line number on which this Token appears.

column number

The 1-indexed column number at which this Token begins.

value string

For non-punctuation tokens, represents the interpreted value of the token.

Note: is undefined for punctuation tokens, but typed as string for convenience in the parser.

prev object

Represents a range of characters represented by a lexical token within a Source.

next object

Represents a range of characters represented by a lexical token within a Source.

__@toStringTag@38 string
source object

A representation of source input to GraphQL. The name and locationOffset parameters are optional, but they are useful for clients who store GraphQL documents in source files. For example, if the GraphQL input starts at line 40 in a file named Foo.graphql, it might be useful for name to be "Foo.graphql" and location to be { line: 40, column: 1 }. The line and column properties in locationOffset are 1-indexed.

4 nested properties
body string
name string
locationOffset object
__@toStringTag@38 string
__@toStringTag@38 string
description object
4 nested properties
kind string
Values: "StringValue"
loc object

Contains a range of UTF-8 character offsets and token references that identify the region of the source from which the AST derived.

6 nested properties
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

startToken object

Represents a range of characters represented by a lexical token within a Source.

endToken object

Represents a range of characters represented by a lexical token within a Source.

source object

A representation of source input to GraphQL. The name and locationOffset parameters are optional, but they are useful for clients who store GraphQL documents in source files. For example, if the GraphQL input starts at line 40 in a file named Foo.graphql, it might be useful for name to be "Foo.graphql" and location to be { line: 40, column: 1 }. The line and column properties in locationOffset are 1-indexed.

__@toStringTag@38 string
value string
block boolean
name object

Name

3 nested properties
kind string

Name

Values: "Name"
loc object

Contains a range of UTF-8 character offsets and token references that identify the region of the source from which the AST derived.

6 nested properties
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

startToken object

Represents a range of characters represented by a lexical token within a Source.

endToken object

Represents a range of characters represented by a lexical token within a Source.

source object

A representation of source input to GraphQL. The name and locationOffset parameters are optional, but they are useful for clients who store GraphQL documents in source files. For example, if the GraphQL input starts at line 40 in a file named Foo.graphql, it might be useful for name to be "Foo.graphql" and location to be { line: 40, column: 1 }. The line and column properties in locationOffset are 1-indexed.

__@toStringTag@38 string
value string
repeatable boolean
locations NameNode[]
Kind.DIRECTIVE_DEFINITION string

Directive Definitions

ReadonlyArray_18 NameNode[]
ScalarTypeExtensionNode object
kind string

Type Extensions

Values: "ScalarTypeExtension"
loc object

Contains a range of UTF-8 character offsets and token references that identify the region of the source from which the AST derived.

6 nested properties
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

startToken object

Represents a range of characters represented by a lexical token within a Source.

9 nested properties
kind string

An exported enum describing the different kinds of tokens that the lexer emits.

Values: "!" "$" "&" "(" ")" "..." ":" "<EOF>" "<SOF>" "=" "@" "BlockString" "Comment" "Float" "Int" "Name" "String" "[" "]" "{" "|" "}"
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

line number

The 1-indexed line number on which this Token appears.

column number

The 1-indexed column number at which this Token begins.

value string

For non-punctuation tokens, represents the interpreted value of the token.

Note: is undefined for punctuation tokens, but typed as string for convenience in the parser.

prev object

Represents a range of characters represented by a lexical token within a Source.

next object

Represents a range of characters represented by a lexical token within a Source.

__@toStringTag@38 string
endToken object

Represents a range of characters represented by a lexical token within a Source.

9 nested properties
kind string

An exported enum describing the different kinds of tokens that the lexer emits.

Values: "!" "$" "&" "(" ")" "..." ":" "<EOF>" "<SOF>" "=" "@" "BlockString" "Comment" "Float" "Int" "Name" "String" "[" "]" "{" "|" "}"
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

line number

The 1-indexed line number on which this Token appears.

column number

The 1-indexed column number at which this Token begins.

value string

For non-punctuation tokens, represents the interpreted value of the token.

Note: is undefined for punctuation tokens, but typed as string for convenience in the parser.

prev object

Represents a range of characters represented by a lexical token within a Source.

next object

Represents a range of characters represented by a lexical token within a Source.

__@toStringTag@38 string
source object

A representation of source input to GraphQL. The name and locationOffset parameters are optional, but they are useful for clients who store GraphQL documents in source files. For example, if the GraphQL input starts at line 40 in a file named Foo.graphql, it might be useful for name to be "Foo.graphql" and location to be { line: 40, column: 1 }. The line and column properties in locationOffset are 1-indexed.

4 nested properties
body string
name string
locationOffset object
__@toStringTag@38 string
__@toStringTag@38 string
name object

Name

3 nested properties
kind string

Name

Values: "Name"
loc object

Contains a range of UTF-8 character offsets and token references that identify the region of the source from which the AST derived.

6 nested properties
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

startToken object

Represents a range of characters represented by a lexical token within a Source.

endToken object

Represents a range of characters represented by a lexical token within a Source.

source object

A representation of source input to GraphQL. The name and locationOffset parameters are optional, but they are useful for clients who store GraphQL documents in source files. For example, if the GraphQL input starts at line 40 in a file named Foo.graphql, it might be useful for name to be "Foo.graphql" and location to be { line: 40, column: 1 }. The line and column properties in locationOffset are 1-indexed.

__@toStringTag@38 string
value string
Kind.SCALAR_TYPE_EXTENSION string

Type Extensions

ObjectTypeExtensionNode object
kind string
Values: "ObjectTypeExtension"
loc object

Contains a range of UTF-8 character offsets and token references that identify the region of the source from which the AST derived.

6 nested properties
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

startToken object

Represents a range of characters represented by a lexical token within a Source.

9 nested properties
kind string

An exported enum describing the different kinds of tokens that the lexer emits.

Values: "!" "$" "&" "(" ")" "..." ":" "<EOF>" "<SOF>" "=" "@" "BlockString" "Comment" "Float" "Int" "Name" "String" "[" "]" "{" "|" "}"
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

line number

The 1-indexed line number on which this Token appears.

column number

The 1-indexed column number at which this Token begins.

value string

For non-punctuation tokens, represents the interpreted value of the token.

Note: is undefined for punctuation tokens, but typed as string for convenience in the parser.

prev object

Represents a range of characters represented by a lexical token within a Source.

next object

Represents a range of characters represented by a lexical token within a Source.

__@toStringTag@38 string
endToken object

Represents a range of characters represented by a lexical token within a Source.

9 nested properties
kind string

An exported enum describing the different kinds of tokens that the lexer emits.

Values: "!" "$" "&" "(" ")" "..." ":" "<EOF>" "<SOF>" "=" "@" "BlockString" "Comment" "Float" "Int" "Name" "String" "[" "]" "{" "|" "}"
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

line number

The 1-indexed line number on which this Token appears.

column number

The 1-indexed column number at which this Token begins.

value string

For non-punctuation tokens, represents the interpreted value of the token.

Note: is undefined for punctuation tokens, but typed as string for convenience in the parser.

prev object

Represents a range of characters represented by a lexical token within a Source.

next object

Represents a range of characters represented by a lexical token within a Source.

__@toStringTag@38 string
source object

A representation of source input to GraphQL. The name and locationOffset parameters are optional, but they are useful for clients who store GraphQL documents in source files. For example, if the GraphQL input starts at line 40 in a file named Foo.graphql, it might be useful for name to be "Foo.graphql" and location to be { line: 40, column: 1 }. The line and column properties in locationOffset are 1-indexed.

4 nested properties
body string
name string
locationOffset object
__@toStringTag@38 string
__@toStringTag@38 string
name object

Name

3 nested properties
kind string

Name

Values: "Name"
loc object

Contains a range of UTF-8 character offsets and token references that identify the region of the source from which the AST derived.

6 nested properties
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

startToken object

Represents a range of characters represented by a lexical token within a Source.

endToken object

Represents a range of characters represented by a lexical token within a Source.

source object

A representation of source input to GraphQL. The name and locationOffset parameters are optional, but they are useful for clients who store GraphQL documents in source files. For example, if the GraphQL input starts at line 40 in a file named Foo.graphql, it might be useful for name to be "Foo.graphql" and location to be { line: 40, column: 1 }. The line and column properties in locationOffset are 1-indexed.

__@toStringTag@38 string
value string
interfaces NamedTypeNode[]
Kind.OBJECT_TYPE_EXTENSION string
InterfaceTypeExtensionNode object
kind string
Values: "InterfaceTypeExtension"
loc object

Contains a range of UTF-8 character offsets and token references that identify the region of the source from which the AST derived.

6 nested properties
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

startToken object

Represents a range of characters represented by a lexical token within a Source.

9 nested properties
kind string

An exported enum describing the different kinds of tokens that the lexer emits.

Values: "!" "$" "&" "(" ")" "..." ":" "<EOF>" "<SOF>" "=" "@" "BlockString" "Comment" "Float" "Int" "Name" "String" "[" "]" "{" "|" "}"
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

line number

The 1-indexed line number on which this Token appears.

column number

The 1-indexed column number at which this Token begins.

value string

For non-punctuation tokens, represents the interpreted value of the token.

Note: is undefined for punctuation tokens, but typed as string for convenience in the parser.

prev object

Represents a range of characters represented by a lexical token within a Source.

next object

Represents a range of characters represented by a lexical token within a Source.

__@toStringTag@38 string
endToken object

Represents a range of characters represented by a lexical token within a Source.

9 nested properties
kind string

An exported enum describing the different kinds of tokens that the lexer emits.

Values: "!" "$" "&" "(" ")" "..." ":" "<EOF>" "<SOF>" "=" "@" "BlockString" "Comment" "Float" "Int" "Name" "String" "[" "]" "{" "|" "}"
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

line number

The 1-indexed line number on which this Token appears.

column number

The 1-indexed column number at which this Token begins.

value string

For non-punctuation tokens, represents the interpreted value of the token.

Note: is undefined for punctuation tokens, but typed as string for convenience in the parser.

prev object

Represents a range of characters represented by a lexical token within a Source.

next object

Represents a range of characters represented by a lexical token within a Source.

__@toStringTag@38 string
source object

A representation of source input to GraphQL. The name and locationOffset parameters are optional, but they are useful for clients who store GraphQL documents in source files. For example, if the GraphQL input starts at line 40 in a file named Foo.graphql, it might be useful for name to be "Foo.graphql" and location to be { line: 40, column: 1 }. The line and column properties in locationOffset are 1-indexed.

4 nested properties
body string
name string
locationOffset object
__@toStringTag@38 string
__@toStringTag@38 string
name object

Name

3 nested properties
kind string

Name

Values: "Name"
loc object

Contains a range of UTF-8 character offsets and token references that identify the region of the source from which the AST derived.

6 nested properties
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

startToken object

Represents a range of characters represented by a lexical token within a Source.

endToken object

Represents a range of characters represented by a lexical token within a Source.

source object

A representation of source input to GraphQL. The name and locationOffset parameters are optional, but they are useful for clients who store GraphQL documents in source files. For example, if the GraphQL input starts at line 40 in a file named Foo.graphql, it might be useful for name to be "Foo.graphql" and location to be { line: 40, column: 1 }. The line and column properties in locationOffset are 1-indexed.

__@toStringTag@38 string
value string
interfaces NamedTypeNode[]
Kind.INTERFACE_TYPE_EXTENSION string
UnionTypeExtensionNode object
kind string
Values: "UnionTypeExtension"
loc object

Contains a range of UTF-8 character offsets and token references that identify the region of the source from which the AST derived.

6 nested properties
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

startToken object

Represents a range of characters represented by a lexical token within a Source.

9 nested properties
kind string

An exported enum describing the different kinds of tokens that the lexer emits.

Values: "!" "$" "&" "(" ")" "..." ":" "<EOF>" "<SOF>" "=" "@" "BlockString" "Comment" "Float" "Int" "Name" "String" "[" "]" "{" "|" "}"
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

line number

The 1-indexed line number on which this Token appears.

column number

The 1-indexed column number at which this Token begins.

value string

For non-punctuation tokens, represents the interpreted value of the token.

Note: is undefined for punctuation tokens, but typed as string for convenience in the parser.

prev object

Represents a range of characters represented by a lexical token within a Source.

next object

Represents a range of characters represented by a lexical token within a Source.

__@toStringTag@38 string
endToken object

Represents a range of characters represented by a lexical token within a Source.

9 nested properties
kind string

An exported enum describing the different kinds of tokens that the lexer emits.

Values: "!" "$" "&" "(" ")" "..." ":" "<EOF>" "<SOF>" "=" "@" "BlockString" "Comment" "Float" "Int" "Name" "String" "[" "]" "{" "|" "}"
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

line number

The 1-indexed line number on which this Token appears.

column number

The 1-indexed column number at which this Token begins.

value string

For non-punctuation tokens, represents the interpreted value of the token.

Note: is undefined for punctuation tokens, but typed as string for convenience in the parser.

prev object

Represents a range of characters represented by a lexical token within a Source.

next object

Represents a range of characters represented by a lexical token within a Source.

__@toStringTag@38 string
source object

A representation of source input to GraphQL. The name and locationOffset parameters are optional, but they are useful for clients who store GraphQL documents in source files. For example, if the GraphQL input starts at line 40 in a file named Foo.graphql, it might be useful for name to be "Foo.graphql" and location to be { line: 40, column: 1 }. The line and column properties in locationOffset are 1-indexed.

4 nested properties
body string
name string
locationOffset object
__@toStringTag@38 string
__@toStringTag@38 string
name object

Name

3 nested properties
kind string

Name

Values: "Name"
loc object

Contains a range of UTF-8 character offsets and token references that identify the region of the source from which the AST derived.

6 nested properties
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

startToken object

Represents a range of characters represented by a lexical token within a Source.

endToken object

Represents a range of characters represented by a lexical token within a Source.

source object

A representation of source input to GraphQL. The name and locationOffset parameters are optional, but they are useful for clients who store GraphQL documents in source files. For example, if the GraphQL input starts at line 40 in a file named Foo.graphql, it might be useful for name to be "Foo.graphql" and location to be { line: 40, column: 1 }. The line and column properties in locationOffset are 1-indexed.

__@toStringTag@38 string
value string
Kind.UNION_TYPE_EXTENSION string
EnumTypeExtensionNode object
kind string
Values: "EnumTypeExtension"
loc object

Contains a range of UTF-8 character offsets and token references that identify the region of the source from which the AST derived.

6 nested properties
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

startToken object

Represents a range of characters represented by a lexical token within a Source.

9 nested properties
kind string

An exported enum describing the different kinds of tokens that the lexer emits.

Values: "!" "$" "&" "(" ")" "..." ":" "<EOF>" "<SOF>" "=" "@" "BlockString" "Comment" "Float" "Int" "Name" "String" "[" "]" "{" "|" "}"
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

line number

The 1-indexed line number on which this Token appears.

column number

The 1-indexed column number at which this Token begins.

value string

For non-punctuation tokens, represents the interpreted value of the token.

Note: is undefined for punctuation tokens, but typed as string for convenience in the parser.

prev object

Represents a range of characters represented by a lexical token within a Source.

next object

Represents a range of characters represented by a lexical token within a Source.

__@toStringTag@38 string
endToken object

Represents a range of characters represented by a lexical token within a Source.

9 nested properties
kind string

An exported enum describing the different kinds of tokens that the lexer emits.

Values: "!" "$" "&" "(" ")" "..." ":" "<EOF>" "<SOF>" "=" "@" "BlockString" "Comment" "Float" "Int" "Name" "String" "[" "]" "{" "|" "}"
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

line number

The 1-indexed line number on which this Token appears.

column number

The 1-indexed column number at which this Token begins.

value string

For non-punctuation tokens, represents the interpreted value of the token.

Note: is undefined for punctuation tokens, but typed as string for convenience in the parser.

prev object

Represents a range of characters represented by a lexical token within a Source.

next object

Represents a range of characters represented by a lexical token within a Source.

__@toStringTag@38 string
source object

A representation of source input to GraphQL. The name and locationOffset parameters are optional, but they are useful for clients who store GraphQL documents in source files. For example, if the GraphQL input starts at line 40 in a file named Foo.graphql, it might be useful for name to be "Foo.graphql" and location to be { line: 40, column: 1 }. The line and column properties in locationOffset are 1-indexed.

4 nested properties
body string
name string
locationOffset object
__@toStringTag@38 string
__@toStringTag@38 string
name object

Name

3 nested properties
kind string

Name

Values: "Name"
loc object

Contains a range of UTF-8 character offsets and token references that identify the region of the source from which the AST derived.

6 nested properties
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

startToken object

Represents a range of characters represented by a lexical token within a Source.

endToken object

Represents a range of characters represented by a lexical token within a Source.

source object

A representation of source input to GraphQL. The name and locationOffset parameters are optional, but they are useful for clients who store GraphQL documents in source files. For example, if the GraphQL input starts at line 40 in a file named Foo.graphql, it might be useful for name to be "Foo.graphql" and location to be { line: 40, column: 1 }. The line and column properties in locationOffset are 1-indexed.

__@toStringTag@38 string
value string
Kind.ENUM_TYPE_EXTENSION string
InputObjectTypeExtensionNode object
kind string
Values: "InputObjectTypeExtension"
loc object

Contains a range of UTF-8 character offsets and token references that identify the region of the source from which the AST derived.

6 nested properties
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

startToken object

Represents a range of characters represented by a lexical token within a Source.

9 nested properties
kind string

An exported enum describing the different kinds of tokens that the lexer emits.

Values: "!" "$" "&" "(" ")" "..." ":" "<EOF>" "<SOF>" "=" "@" "BlockString" "Comment" "Float" "Int" "Name" "String" "[" "]" "{" "|" "}"
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

line number

The 1-indexed line number on which this Token appears.

column number

The 1-indexed column number at which this Token begins.

value string

For non-punctuation tokens, represents the interpreted value of the token.

Note: is undefined for punctuation tokens, but typed as string for convenience in the parser.

prev object

Represents a range of characters represented by a lexical token within a Source.

next object

Represents a range of characters represented by a lexical token within a Source.

__@toStringTag@38 string
endToken object

Represents a range of characters represented by a lexical token within a Source.

9 nested properties
kind string

An exported enum describing the different kinds of tokens that the lexer emits.

Values: "!" "$" "&" "(" ")" "..." ":" "<EOF>" "<SOF>" "=" "@" "BlockString" "Comment" "Float" "Int" "Name" "String" "[" "]" "{" "|" "}"
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

line number

The 1-indexed line number on which this Token appears.

column number

The 1-indexed column number at which this Token begins.

value string

For non-punctuation tokens, represents the interpreted value of the token.

Note: is undefined for punctuation tokens, but typed as string for convenience in the parser.

prev object

Represents a range of characters represented by a lexical token within a Source.

next object

Represents a range of characters represented by a lexical token within a Source.

__@toStringTag@38 string
source object

A representation of source input to GraphQL. The name and locationOffset parameters are optional, but they are useful for clients who store GraphQL documents in source files. For example, if the GraphQL input starts at line 40 in a file named Foo.graphql, it might be useful for name to be "Foo.graphql" and location to be { line: 40, column: 1 }. The line and column properties in locationOffset are 1-indexed.

4 nested properties
body string
name string
locationOffset object
__@toStringTag@38 string
__@toStringTag@38 string
name object

Name

3 nested properties
kind string

Name

Values: "Name"
loc object

Contains a range of UTF-8 character offsets and token references that identify the region of the source from which the AST derived.

6 nested properties
start number

The character offset at which this Node begins.

end number

The character offset at which this Node ends.

startToken object

Represents a range of characters represented by a lexical token within a Source.

endToken object

Represents a range of characters represented by a lexical token within a Source.

source object

A representation of source input to GraphQL. The name and locationOffset parameters are optional, but they are useful for clients who store GraphQL documents in source files. For example, if the GraphQL input starts at line 40 in a file named Foo.graphql, it might be useful for name to be "Foo.graphql" and location to be { line: 40, column: 1 }. The line and column properties in locationOffset are 1-indexed.

__@toStringTag@38 string
value string
Kind.INPUT_OBJECT_TYPE_EXTENSION string
Error object
name string
message string
stack string
GraphQLErrorExtensions Record<string, any>

Custom extensions

Maybe_2 GraphQLError[]
Types.SchemaWithLoader Record<string, object>
Types.SchemaWithLoaderOptions object

Loads schema using a pointer, with a custom loader (code file).

loader string

Specify a path to a custom code file (local or module) that will handle the schema loading.

Types.SchemaFromCodeFile Record<string, object>
Types.SchemaFromCodeFileOptions object

Loads schema using a pointer, without using require while looking for schemas in code files.

noRequire boolean

Set this to true in order to tell codegen not to try to require files in order to find schema/docs

noPluck boolean

Set this to true in order to tell codegen not to try to extract GraphQL AST strings schema/docs

assumeValid boolean

Set this to true in order to tell codegen to skip documents validation.

Types.UrlSchemaWithOptions Record<string, object>
Types.UrlSchemaOptions object

Loads a schema from remote endpoint, with custom http options.

headers Record<string, string>

HTTP headers you wish to add to the HTTP request sent by codegen to fetch your GraphQL remote schema.

customFetch Types.CustomSchemaFetcher | string

Specify a Node module name, a custom file, or a function, to be used instead of a standard fetch.

method string

HTTP Method to use, either POST (default) or GET.

handleAsSDL boolean

Handling the response as SDL will allow you to load schema from remote server that doesn't return a JSON introspection.

__type object

A function to use for fetching the schema.

Types.CustomSchemaFetcher object

A function to use for fetching the schema.

Types.LocalSchemaPathWithOptions Record<string, object>
Types.LocalSchemaPathOptions object

Loads a schema a local file or files, with customized options for parsing/loading.

skipGraphQLImport boolean

Skips checks for graphql-import syntax and loads the file as-is, without imports support. Default value: "true"

commentDescriptions boolean

Converts all GraphQL comments (# sign) to descriptions during the parse phase, to make it available for plugins later. Default value: "false"

assumeValidSDL boolean

Set to true to assume the SDL is valid. Default value: "false"

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. Default value: "false"

allowLegacySDLEmptyFields boolean

If enabled, the parser will parse empty fields sets in the Schema Definition Language. Otherwise, the parser will follow the current specification.

This option is provided to ease adoption of the final SDL specification and will be removed in v16. Default value: "false"

allowLegacySDLImplementsInterfaces boolean

If enabled, the parser will parse implemented interfaces with no & character between each interface. Otherwise, the parser will follow the current specification.

This option is provided to ease adoption of the final SDL specification and will be removed in v16. Default value: "false"

experimentalFragmentVariables boolean

EXPERIMENTAL:

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 { ... }

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

Types.ApolloEngineSchemaOptions object
apollo-engine object

Additional options for loading from Apollo Engine

14 nested properties
engine object
2 nested properties
endpoint string
apiKey string
graph string
variant string
headers __type_1
noLocation boolean
allowLegacySDLEmptyFields boolean
allowLegacySDLImplementsInterfaces boolean
experimentalFragmentVariables boolean
commentDescriptions boolean

Set to true in order to convert all GraphQL comments (marked with # sign) to descriptions (""") GraphQL has built-in support for transforming descriptions to comments (with print), but not while parsing. Turning the flag on will support the other way as well (parse)

assumeValidSDL boolean

Set to true to assume the SDL is valid.

Default: false

assumeValid boolean

When building a schema from a GraphQL service's introspection result, it might be safe to assume the schema is valid. Set to true to assume the produced schema is valid.

Default: false

cwd string
ignore string[] | string
includeSources boolean
ApolloEngineOptions object

Additional options for loading from Apollo Engine

engine object
2 nested properties
endpoint string
apiKey string
graph string
variant string
headers __type_1
noLocation boolean
allowLegacySDLEmptyFields boolean
allowLegacySDLImplementsInterfaces boolean
experimentalFragmentVariables boolean
commentDescriptions boolean

Set to true in order to convert all GraphQL comments (marked with # sign) to descriptions (""") GraphQL has built-in support for transforming descriptions to comments (with print), but not while parsing. Turning the flag on will support the other way as well (parse)

assumeValidSDL boolean

Set to true to assume the SDL is valid.

Default: false

assumeValid boolean

When building a schema from a GraphQL service's introspection result, it might be safe to assume the schema is valid. Set to true to assume the produced schema is valid.

Default: false

cwd string
ignore string[] | string
includeSources boolean
__type_1 object
Record object
Types.GitHubSchemaOptions Record<string, object>
Types.Schema GraphQLSchema | Types.SchemaWithLoader | Types.SchemaFromCodeFile | Types.UrlSchemaWithOptions | Types.LocalSchemaPathWithOptions | Types.ApolloEngineSchemaOptions | Types.GitHubSchemaOptions | string

A URL to your GraphQL endpoint, a local path to .graphql file, a glob pattern to your GraphQL schema files, or a JavaScript file that exports the schema to generate code from. This can also be an array which specifies multiple schemas to generate code from. You can read more about the supported formats here.

Types.RequireExtension string[] | string
Types.InstanceOrArray_1 Types.CustomDocumentLoader | Types.OperationDocument[] | string
Types.CustomDocumentLoader Record<string, object>
Types.CustomDocumentLoaderOptions object

Specify a path to a custom loader for your GraphQL documents.

loader string

Specify a path to a custom code file (local or module) that will handle the documents loading.

Types.OperationDocument Types.CustomDocumentLoader | string
Types.ConfiguredPlugin Record<string, object>
flutter-freezed object

configure the flutter-freezed plugin

15 nested properties
camelCasedEnums {(boolean | DartIdentifierCasing)}

Setting this option to true will camelCase enum values as required by Dart's recommended linter.

If set to false, the original casing as specified in the Graphql Schema is used

You can also transform the casing by specifying your preferred casing for Enum values.

Available options are: 'snake_case', 'camelCase' and 'PascalCase'

For consistency, this option applies the same configuration to all Enum Types in the GraphQL Schema Default value: "true"

copyWith {(boolean | TypeNamePattern)}

The freezed library has this option enabled by default. Use this option to enable/disable this option completely.

The plugin by default generates immutable Freezed models using the @freezed decorator.

If this option is configured, the plugin will generate immutable Freezed models using the @Freezed(copyWith: value) instead.

Setting a boolean value will enable/disable this option globally for every GraphQL Type but you can also set this option to true for one or more GraphQL Types using a TypeNamePattern. Default value: "undefined"

customScalars {(Record<string, string>)}

The key is the GraphQL Scalar Type and the value is the equivalent Dart Type

The plugin automatically handles built-in GraphQL Scalar Types so only specify the custom Scalars in your Graphql Schema. Default value: "[object Object]"

defaultValues {([pattern: FieldNamePattern, value: string, appliesOn: AppliesOnParameters[]][])}

This will annotate the generated parameter with a @Default(value: defaultValue) decorator.

The default value will be interpolated into the @Default(value: ${value}) decorator so Use backticks for the value element so that you can use quotation marks for string values. E.g: "I'm a string default value" but Episode.jedi is not a string value.

Use the appliesOn to specify where this option should be applied on Default value: "undefined"

deprecated {([pattern: Pattern, appliesOn: (AppliesOnFactory | AppliesOnParameters)[]][])}

Using a TypeNamePattern, you can mark an entire factory constructor for one or more GraphQL types as deprecated.

Likewise, using a FieldNamePattern, you can mark one or more fields as deprecated

Since the first element in the tuple has a type signature of Pattern, you can use either TypeNamePattern or FieldNamePattern or use both by composing them with Pattern.compose(...)

Use the appliesOn to specify which block this option should be applied on Default value: "undefined"

equal {(boolean | TypeNamePattern)}

The freezed library has this option enabled by default. Use this option to enable/disable this option completely.

The plugin by default generates immutable Freezed models using the @freezed decorator.

If this option is configured, the plugin will generate immutable Freezed models using the @Freezed(equal: value) instead.

Setting a boolean value will enable/disable this option globally for every GraphQL Type but you can also set this option to true for one or more GraphQL Types using a TypeNamePattern. Default value: "undefined"

escapeDartKeywords {(boolean | [pattern: Pattern, prefix?: string, suffix?: string, appliesOn?: AppliesOn[]][])}

Wraps the fields names that are valid Dart keywords with the prefix and suffix given Default value: "true"

final {([pattern: FieldNamePattern, appliesOn: AppliesOnParameters[]][])}

This will mark the specified parameters as final Default value: "undefined"

ignoreTypes {(TypeNamePattern)}

names of GraphQL types to ignore when generating Freezed classes Default value: "undefined"

immutable {(boolean | TypeNamePattern)}

The freezed library by default generates immutable models decorated with the @freezed decorator. This option if set to false the plugin will generate mutable Freezed models using the @unfreezed decorator instead.

Setting a boolean value will enable/disable this option globally for every GraphQL Type but you can also set this option to true for one or more GraphQL Types using a TypeNamePattern. Default value: "undefined"

makeCollectionsUnmodifiable {(boolean | TypeNamePattern)}

allows collections(lists/maps) to be modified even if class is immutable Default value: "undefined"

mergeTypes {(Record<string, TypeName[]>)}

maps over the value(array of typeNames) and transform each as a named factory constructor inside a class generated for the key(target GraphQL Object Type). Default value: "undefined"

mutableInputs TypeNamePattern | boolean

since inputs will be used to collect data, it makes sense to make them mutable with Freezed's @unfreezed decorator.

This overrides(in order words: has a higher precedence than) the immutable config value ONLY for GraphQL input types. Default value: "true"

privateEmptyConstructor TypeNamePattern | boolean

if true, defines a private empty constructor to allow getter and methods to work on the class Default value: "true"

unionClass array[]

customize the key to be used for fromJson with multiple constructors Default value: "undefined"

typescript-react-query object

This plugin generates React-Query Hooks with TypeScript typings.

It extends the basic TypeScript plugins: @graphql-codegen/typescript, @graphql-codegen/typescript-operations - and thus shares a similar configuration.

If you are using the react-query package instead of the @tanstack/react-query package in your project, please set the legacyMode option to true.

29 nested properties
fetcher HardcodedFetch | object | string

Customize the fetcher you wish to use in the generated file. React-Query is agnostic to the data-fetching layer, so you should provide it, or use a custom one.

The following options are available to use:

  • 'fetch' - requires you to specify endpoint and headers on each call, and uses fetch to do the actual http call.
  • { endpoint: string, fetchParams: RequestInit }: hardcode your endpoint and fetch options into the generated output, using the environment fetch method. You can also use process.env.MY_VAR as endpoint or header value.
  • file#identifier - You can use custom fetcher method that should implement the exported ReactQueryFetcher interface. Example: ./my-fetcher#myCustomFetcher.
  • graphql-request: Will generate each hook with client argument, where you should pass your own GraphQLClient (created from graphql-request).
exposeDocument boolean

For each generate query hook adds document field with a corresponding GraphQL query. Useful for queryClient.fetchQuery. Default value: "false"

exposeQueryKeys boolean

For each generate query hook adds getKey(variables: QueryVariables) function. Useful for cache updates. If addInfiniteQuery is true, it will also add a getKey function to each infinite query. Default value: "false"

exposeMutationKeys boolean

For each generate mutation hook adds getKey() function. Useful for call outside of functional component. Default value: "false"

exposeFetcher boolean

For each generate query hook adds fetcher field with a corresponding GraphQL query using the fetcher. It is useful for queryClient.fetchQuery and queryClient.prefetchQuery. Default value: "false"

errorType string

Changes the default "TError" generic type. Default value: "unknown"

addInfiniteQuery boolean

Adds an Infinite Query along side the standard one Default value: "false"

legacyMode boolean

If false, it will work with @tanstack/react-query, default value is true. Default value: "true"

namingConvention NamingConventionFn | NamingConventionMap | string
operationResultSuffix string

Adds a suffix to generated operation result type names Default value: ""

dedupeOperationSuffix boolean

Set this configuration to true if you wish to make sure to remove duplicate operation name suffix. Default value: "false"

omitOperationSuffix boolean

Set this configuration to true if you wish to disable auto add suffix of operation name, like Query, Mutation, Subscription, Fragment. Default value: "false"

documentVariablePrefix string

Changes the GraphQL operations variables prefix. Default value: ""

documentVariableSuffix string

Changes the GraphQL operations variables suffix. Default value: "Document"

fragmentVariablePrefix string

Changes the GraphQL fragments variables prefix. Default value: ""

fragmentVariableSuffix string

Changes the GraphQL fragments variables suffix. Default value: "FragmentDoc"

pureMagicComment boolean

This config adds PURE magic comment to the static variables to enforce treeshaking for your bundler. Default value: "false"

optimizeDocumentNode boolean

If you are using documentNode: documentMode | documentNodeImportFragments, you can set this to true to apply document optimizations for your GraphQL document. This will remove all "loc" and "description" fields from the compiled document, and will remove all empty arrays (such as directives, arguments and variableDefinitions). Default value: "true"

experimentalFragmentVariables boolean

If set to true, it will enable support for parsing variables on fragments. Default value: "false"

scalars object | string

Scalars map or a string, a map between the GraphQL scalar name and the identifier that should be used

typesPrefix string

Prefixes all the generated types. Default value: ""

typesSuffix string

Suffixes all the generated types. Default value: ""

nonOptionalTypename boolean

Automatically adds __typename field to the generated types, even when they are not specified in the selection set, and makes it non-optional Default value: "false"

inlineFragmentTypes string

Whether fragment types should be inlined into other operations. "inline" is the default behavior and will perform deep inlining fragment types within operation type definitions. "combine" is the previous behavior that uses fragment type references without inlining the types (and might cause issues with deeply nested fragment that uses list types). Default value: "inline"

emitLegacyCommonJSImports boolean

Emit legacy common js imports. Default it will be true this way it ensure that generated code works with non-compliant bundlers. Default value: "true"

strictScalars boolean

Makes scalars strict.

If scalars are found in the schema that are not defined in scalars an error will be thrown during codegen. Default value: "false"

defaultScalarType string

Allows you to override the type that unknown scalars will have. Default value: "any"

skipTypename boolean

Does not add __typename to the generated types, unless it was specified in the selection set. Default value: "false"

dedupeFragments boolean

Removes fragment duplicates for reducing data transfer. It is done by removing sub-fragments imports from fragment definition Instead - all of them are imported to the Operation node. Default value: "false"

typescript-rtk-query object
5 nested properties
importBaseApiFrom string

Define where to import the base api to inject endpoints into

importBaseApiAlternateName string

Change the import name of the baseApi from default 'api' Default value: "'api'"

exportHooks boolean

Whether to export React Hooks from the generated api. Enable only when using the "@reduxjs/toolkit/query/react" import of createApi Default value: "false"

overrideExisting string

Sets the overrideExisting option, for example to allow for hot module reloading when running graphql-codegen in watch mode. Will directly be injected as code. Default value: "undefined"

addTransformResponse boolean

Sets the addTransformResponse option, which will automatically add a types transformResponse for query Default value: "false"

typescript-generic-sdk object

This plugin generate a generic SDK (without any Requester implemented), allow you to easily customize the way you fetch your data, without loosing the strongly-typed integration.

33 nested properties
usingObservableFrom string

usingObservableFrom: import Observable from 'zen-observable' OR usingObservableFrom: import { Observable } from 'rxjs'

rawRequest boolean

By default the request method return the data or errors key from the response. If you need to access the extensions key you can use the rawRequest method. Default value: "false"

gqlImport string

Customize from which module will gql be imported from. This is useful if you want to use modules other than graphql-tag, e.g. graphql.macro. Default value: "graphql-tag#gql"

documentNodeImport string

Customize from which module will DocumentNode be imported from. This is useful if you want to use modules other than graphql, e.g. @graphql-typed-document-node. Default value: "graphql#DocumentNode"

noExport boolean

Set this configuration to true if you wish to tell codegen to generate code with no export identifier. Default value: "false"

dedupeOperationSuffix boolean

Set this configuration to true if you wish to make sure to remove duplicate operation name suffix. Default value: "false"

omitOperationSuffix boolean

Set this configuration to true if you wish to disable auto add suffix of operation name, like Query, Mutation, Subscription, Fragment. Default value: "false"

operationResultSuffix string

Adds a suffix to generated operation result type names Default value: ""

documentVariablePrefix string

Changes the GraphQL operations variables prefix. Default value: ""

documentVariableSuffix string

Changes the GraphQL operations variables suffix. Default value: "Document"

fragmentVariablePrefix string

Changes the GraphQL fragments variables prefix. Default value: ""

fragmentVariableSuffix string

Changes the GraphQL fragments variables suffix. Default value: "FragmentDoc"

documentMode string
Values: "documentNode" "documentNodeImportFragments" "external" "graphQLTag" "string"
optimizeDocumentNode boolean

If you are using documentMode: documentNode | documentNodeImportFragments, you can set this to true to apply document optimizations for your GraphQL document. This will remove all "loc" and "description" fields from the compiled document, and will remove all empty arrays (such as directives, arguments and variableDefinitions). Default value: "true"

importOperationTypesFrom string

This config is used internally by presets, but you can use it manually to tell codegen to prefix all base types that it's using. This is useful if you wish to generate base types from typescript-operations plugin into a different file, and import it from there. Default value: ""

importDocumentNodeExternallyFrom string

This config should be used if documentMode is external. This has 2 usage:

  • any string: This would be the path to import document nodes from. This can be used if we want to manually create the document nodes e.g. Use graphql-tag in a separate file and export the generated document
  • 'near-operation-file': This is a special mode that is intended to be used with near-operation-file preset to import document nodes from those files. If these files are .graphql files, we make use of webpack loader. Default value: ""
pureMagicComment boolean

This config adds PURE magic comment to the static variables to enforce treeshaking for your bundler. Default value: "false"

experimentalFragmentVariables boolean

If set to true, it will enable support for parsing variables on fragments. Default value: "false"

strictScalars boolean

Makes scalars strict.

If scalars are found in the schema that are not defined in scalars an error will be thrown during codegen. Default value: "false"

defaultScalarType string

Allows you to override the type that unknown scalars will have. Default value: "any"

scalars object | string

Scalars map or a string, a map between the GraphQL scalar name and the identifier that should be used

namingConvention NamingConventionFn_1 | NamingConventionMap_1 | string
typesPrefix string

Prefixes all the generated types. Default value: ""

typesSuffix string

Suffixes all the generated types. Default value: ""

skipTypename boolean

Does not add __typename to the generated types, unless it was specified in the selection set. Default value: "false"

nonOptionalTypename boolean

Automatically adds __typename field to the generated types, even when they are not specified in the selection set, and makes it non-optional Default value: "false"

useTypeImports boolean

Will use import type {} rather than import {} when importing only types. This gives compatibility with TypeScript's "importsNotUsedAsValues": "error" option Default value: "false"

inlineFragmentTypes string

Whether fragment types should be inlined into other operations. "inline" is the default behavior and will perform deep inlining fragment types within operation type definitions. "combine" is the previous behavior that uses fragment type references without inlining the types (and might cause issues with deeply nested fragment that uses list types). "mask" transforms the types for use with fragment masking. Useful when masked types are needed when not using the "client" preset e.g. such as combining it with Apollo Client's data masking feature. Default value: "inline"

emitLegacyCommonJSImports boolean

Emit legacy common js imports. Default it will be true this way it ensure that generated code works with non-compliant bundlers. Default value: "true"

importExtension string[] | string

Append this extension to all imports. Useful for ESM environments that require file extensions in import statements.

extractAllFieldsToTypes boolean

Extract all field types to their own types, instead of inlining them. This helps to reduce type duplication, and makes type errors more readable. It can also significantly reduce the size of the generated code, the generation time, and the typechecking time. Default value: "false"

printFieldsOnNewLines boolean

If you prefer to have each field in generated types printed on a new line, set this to true. This can be useful for improving readability of the resulting types, without resorting to running tools like Prettier on the output. Default value: "false"

includeExternalFragments boolean

Whether to include external fragments in the generated code. External fragments are not defined in the same location as the operation definition. Default value: "false"

typescript-apollo-client-helpers object
3 nested properties
useTypeImports boolean

Will use import type {} rather than import {} when importing only types. This gives compatibility with TypeScript's "importsNotUsedAsValues": "error" option Default value: "false"

requireKeyFields boolean

Remove optional sign from all keyFields fields. Default value: "false"

requirePoliciesForAllTypes boolean

Remove optional sign from all generated keys of the root TypePolicy. Default value: "false"

add object
2 nested properties
placement string

Allow you to choose where to add the content. Default value: "prepend"

Values: "append" "content" "prepend"
content string[] | string

The actual content you wish to add, either a string or array of strings. You can also specify a path to a local file and the content if it will be loaded by codegen.

time object
2 nested properties
format string

Customize the Moment format of the output time. Default value: "YYYY-MM-DDTHH:mm:ssZ"

message string

Customize the comment message Default value: "'Generated on'"

typescript object

This plugin generates the base TypeScript types, based on your GraphQL schema.

The types generated by this plugin are simple, and refers to the exact structure of your schema, and it's used as the base types for other plugins (such as typescript-operations / typescript-resolvers)

43 nested properties
avoidOptionals AvoidOptionalsConfig | boolean

This will cause the generator to avoid using TypeScript optionals (?) on types, so the following definition: type A { myField: String } will output myField: Maybe<string> instead of myField?: Maybe<string>. Default value: "false"

constEnums boolean

Will prefix every generated enum with const, you can read more about const enums here: https://www.typescriptlang.org/docs/handbook/enums.html. Default value: "false"

enumsAsTypes boolean

Generates enum as TypeScript string union type instead of an enum. Useful if you wish to generate .d.ts declaration file instead of .ts, or if you want to avoid using TypeScript enums due to bundle size concerns Default value: "false"

numericEnums boolean

Controls whether to preserve typescript enum values as numbers Default value: "false"

futureProofEnums boolean

This option controls whether or not a catch-all entry is added to enum type definitions for values that may be added in the future. This is useful if you are using relay. Default value: "false"

futureProofUnions boolean

This option controls whether or not a catch-all entry is added to union type definitions for values that may be added in the future. This is useful if you are using relay. Default value: "false"

enumsAsConst boolean

Generates enum as TypeScript const assertions instead of enum. This can even be used to enable enum-like patterns in plain JavaScript code if you choose not to use TypeScript’s enum construct. Default value: "false"

onlyEnums boolean

This will cause the generator to emit types for enums only. Default value: "false"

onlyOperationTypes boolean

This will cause the generator to emit types for operations only (basically only enums and scalars). Interacts well with preResolveTypes: true Default value: "false"

immutableTypes boolean

Generates immutable types by adding readonly to properties and uses ReadonlyArray. Default value: "false"

maybeValue string

Allow to override the type value of Maybe. Default value: "T | null"

inputMaybeValue string

Allow to override the type value of Maybe for input types and arguments. This is useful in case you want to differentiate between the wrapper of input and output types. By default, this type just refers to Maybe type, but you can override its definition. Default value: "Maybe"

noExport boolean

Set to true in order to generate output without export modifier. This is useful if you are generating .d.ts file and want it to be globally available. Default value: "false"

disableDescriptions boolean

Set the value to true in order to disable all description generation. Default value: "false"

useImplementingTypes boolean

When a GraphQL interface is used for a field, this flag will use the implementing types, instead of the interface itself. Default value: "false"

wrapEntireFieldDefinitions boolean

Set to true in order to wrap field definitions with EntireFieldWrapper. This is useful to allow return types such as Promises and functions for fields. Differs from wrapFieldDefinitions in that this wraps the entire field definition if i.e. the field is an Array, while wrapFieldDefinitions will wrap every single value inside the array. Default value: "false"

entireFieldWrapperValue string

Allow to override the type value of EntireFieldWrapper. This wrapper applies outside of Array and Maybe unlike fieldWrapperValue, that will wrap the inner type. Default value: "T | Promise | (() => T | Promise)"

allowEnumStringTypes boolean

Allow using enum string values directly.

addUnderscoreToArgsType boolean

Adds _ to generated Args types in order to avoid duplicate identifiers.

enumValues object | string

A raw configuration for enumValues map - can be represented with a single string value for a file path, a map between enum name and a file path, or a map between enum name and an object with explicit enum values.

declarationKind DeclarationKindConfig | string

Overrides the default output for various GraphQL elements.

enumPrefix boolean

Allow you to disable prefixing for generated enums, works in combination with typesPrefix. Default value: "true"

enumSuffix boolean

Allow you to disable suffixing for generated enums, works in combination with typesSuffix. Default value: "true"

fieldWrapperValue string

Allow you to add wrapper for field type, use T as the generic value. Make sure to set wrapFieldDefinitions to true in order to make this flag work. Default value: "T"

wrapFieldDefinitions boolean

Set to true in order to wrap field definitions with FieldWrapper. This is useful to allow return types such as Promises and functions. Default value: "false"

ignoreEnumValuesFromSchema boolean

This will cause the generator to ignore enum values defined in GraphQLSchema Default value: "false"

directiveArgumentAndInputFieldMappings __type_15
directiveArgumentAndInputFieldMappingTypeSuffix string

Adds a suffix to the imported names to prevent name clashes.

strictScalars boolean

Makes scalars strict.

If scalars are found in the schema that are not defined in scalars an error will be thrown during codegen. Default value: "false"

defaultScalarType string

Allows you to override the type that unknown scalars will have. Default value: "any"

scalars object | string

Scalars map or a string, a map between the GraphQL scalar name and the identifier that should be used

namingConvention NamingConventionFn_1 | NamingConventionMap_1 | string
typesPrefix string

Prefixes all the generated types. Default value: ""

typesSuffix string

Suffixes all the generated types. Default value: ""

skipTypename boolean

Does not add __typename to the generated types, unless it was specified in the selection set. Default value: "false"

nonOptionalTypename boolean

Automatically adds __typename field to the generated types, even when they are not specified in the selection set, and makes it non-optional Default value: "false"

useTypeImports boolean

Will use import type {} rather than import {} when importing only types. This gives compatibility with TypeScript's "importsNotUsedAsValues": "error" option Default value: "false"

inlineFragmentTypes string

Whether fragment types should be inlined into other operations. "inline" is the default behavior and will perform deep inlining fragment types within operation type definitions. "combine" is the previous behavior that uses fragment type references without inlining the types (and might cause issues with deeply nested fragment that uses list types). "mask" transforms the types for use with fragment masking. Useful when masked types are needed when not using the "client" preset e.g. such as combining it with Apollo Client's data masking feature. Default value: "inline"

emitLegacyCommonJSImports boolean

Emit legacy common js imports. Default it will be true this way it ensure that generated code works with non-compliant bundlers. Default value: "true"

importExtension string[] | string

Append this extension to all imports. Useful for ESM environments that require file extensions in import statements.

extractAllFieldsToTypes boolean

Extract all field types to their own types, instead of inlining them. This helps to reduce type duplication, and makes type errors more readable. It can also significantly reduce the size of the generated code, the generation time, and the typechecking time. Default value: "false"

printFieldsOnNewLines boolean

If you prefer to have each field in generated types printed on a new line, set this to true. This can be useful for improving readability of the resulting types, without resorting to running tools like Prettier on the output. Default value: "false"

includeExternalFragments boolean

Whether to include external fragments in the generated code. External fragments are not defined in the same location as the operation definition. Default value: "false"

typescript-operations object

This plugin generates TypeScript types based on your GraphQLSchema and your GraphQL operations and fragments. It generates types for your GraphQL documents: Query, Mutation, Subscription and Fragment.

Note: In most configurations, this plugin requires you to use `typescript as well, because it depends on its base types.

49 nested properties
arrayInputCoercion boolean

The GraphQL spec allows arrays and a single primitive value for list input. This allows to deactivate that behavior to only accept arrays instead of single values. If set to false, the definition: query foo(bar: [Int!]!): Foo will output bar: Array<Int> instead of bar: Array<Int> | Int for the variable part. Default value: "true"

avoidOptionals AvoidOptionalsConfig | boolean

This will cause the generator to avoid using TypeScript optionals (?) on types, so the following definition: type A { myField: String } will output myField: Maybe<string> instead of myField?: Maybe<string>. Default value: "false"

immutableTypes boolean

Generates immutable types by adding readonly to properties and uses ReadonlyArray. Default value: "false"

flattenGeneratedTypes boolean

Flatten fragment spread and inline fragments into a simple selection set before generating. Default value: "false"

flattenGeneratedTypesIncludeFragments boolean

Include all fragments types when flattenGeneratedTypes is enabled. Default value: "false"

noExport boolean

Set to true in order to generate output without export modifier. This is useful if you are generating .d.ts file and want it to be globally available. Default value: "false"

globalNamespace boolean
addOperationExport boolean

Add const export of the operation name to output file. Pay attention that the file should be d.ts. You can combine it with near-operation-file preset and therefore the types will be generated along with graphql file. Then you need to set extension in presetConfig to be .gql.d.ts and by that you can import gql file in ts files. It will allow you to get everything with one import:

import { GetClient, GetClientQuery, GetClientQueryVariables } from './GetClient.gql.js'

Default value: "false"

maybeValue string

Allow to override the type value of Maybe. Default value: "T | null"

allowUndefinedQueryVariables boolean

Adds undefined as a possible type for query variables Default value: "false"

nullability object

Options related to handling nullability

1 nested properties
errorHandlingClient boolean
preResolveTypes boolean

Uses primitive types where possible. Set to false in order to use Pick and take use the types generated by typescript plugin. Default value: "true"

skipTypeNameForRoot boolean

Avoid adding __typename for root types. This is ignored when a selection explicitly specifies __typename. Default value: "false"

operationResultSuffix string

Adds a suffix to generated operation result type names Default value: ""

dedupeOperationSuffix boolean

Set this configuration to true if you wish to make sure to remove duplicate operation name suffix. Default value: "false"

omitOperationSuffix boolean

Set this configuration to true if you wish to disable auto add suffix of operation name, like Query, Mutation, Subscription, Fragment. Default value: "false"

exportFragmentSpreadSubTypes boolean

If set to true, it will export the sub-types created in order to make it easier to access fields declared under fragment spread. Default value: "false"

experimentalFragmentVariables boolean

If set to true, it will enable support for parsing variables on fragments. Default value: "false"

mergeFragmentTypes boolean

If set to true, merge equal fragment interfaces. Default value: "false"

customDirectives object
1 nested properties
apolloUnmask boolean

Adds integration with Apollo Client's @unmask directive when using Apollo Client's data masking feature. @unmask ensures fields marked by @unmask are available in the type definition. Default value: "false"

addUnderscoreToArgsType boolean

Adds _ to generated Args types in order to avoid duplicate identifiers.

enumValues object | string

A raw configuration for enumValues map - can be represented with a single string value for a file path, a map between enum name and a file path, or a map between enum name and an object with explicit enum values.

declarationKind DeclarationKindConfig | string

Overrides the default output for various GraphQL elements.

enumPrefix boolean

Allow you to disable prefixing for generated enums, works in combination with typesPrefix. Default value: "true"

enumSuffix boolean

Allow you to disable suffixing for generated enums, works in combination with typesSuffix. Default value: "true"

fieldWrapperValue string

Allow you to add wrapper for field type, use T as the generic value. Make sure to set wrapFieldDefinitions to true in order to make this flag work. Default value: "T"

wrapFieldDefinitions boolean

Set to true in order to wrap field definitions with FieldWrapper. This is useful to allow return types such as Promises and functions. Default value: "false"

onlyEnums boolean

This will cause the generator to emit types for enums only Default value: "false"

onlyOperationTypes boolean

This will cause the generator to emit types for operations only (basically only enums and scalars) Default value: "false"

ignoreEnumValuesFromSchema boolean

This will cause the generator to ignore enum values defined in GraphQLSchema Default value: "false"

wrapEntireFieldDefinitions boolean

Set to true in order to wrap field definitions with EntireFieldWrapper. This is useful to allow return types such as Promises and functions for fields. Differs from wrapFieldDefinitions in that this wraps the entire field definition if i.e. the field is an Array, while wrapFieldDefinitions will wrap every single value inside the array. Default value: "true"

entireFieldWrapperValue string

Allow to override the type value of EntireFieldWrapper. This wrapper applies outside of Array and Maybe unlike fieldWrapperValue, that will wrap the inner type. Default value: "T | Promise | (() => T | Promise)"

directiveArgumentAndInputFieldMappings __type_15
directiveArgumentAndInputFieldMappingTypeSuffix string

Adds a suffix to the imported names to prevent name clashes.

strictScalars boolean

Makes scalars strict.

If scalars are found in the schema that are not defined in scalars an error will be thrown during codegen. Default value: "false"

defaultScalarType string

Allows you to override the type that unknown scalars will have. Default value: "any"

scalars object | string

Scalars map or a string, a map between the GraphQL scalar name and the identifier that should be used

namingConvention NamingConventionFn_1 | NamingConventionMap_1 | string
typesPrefix string

Prefixes all the generated types. Default value: ""

typesSuffix string

Suffixes all the generated types. Default value: ""

skipTypename boolean

Does not add __typename to the generated types, unless it was specified in the selection set. Default value: "false"

nonOptionalTypename boolean

Automatically adds __typename field to the generated types, even when they are not specified in the selection set, and makes it non-optional Default value: "false"

useTypeImports boolean

Will use import type {} rather than import {} when importing only types. This gives compatibility with TypeScript's "importsNotUsedAsValues": "error" option Default value: "false"

inlineFragmentTypes string

Whether fragment types should be inlined into other operations. "inline" is the default behavior and will perform deep inlining fragment types within operation type definitions. "combine" is the previous behavior that uses fragment type references without inlining the types (and might cause issues with deeply nested fragment that uses list types). "mask" transforms the types for use with fragment masking. Useful when masked types are needed when not using the "client" preset e.g. such as combining it with Apollo Client's data masking feature. Default value: "inline"

emitLegacyCommonJSImports boolean

Emit legacy common js imports. Default it will be true this way it ensure that generated code works with non-compliant bundlers. Default value: "true"

importExtension string[] | string

Append this extension to all imports. Useful for ESM environments that require file extensions in import statements.

extractAllFieldsToTypes boolean

Extract all field types to their own types, instead of inlining them. This helps to reduce type duplication, and makes type errors more readable. It can also significantly reduce the size of the generated code, the generation time, and the typechecking time. Default value: "false"

printFieldsOnNewLines boolean

If you prefer to have each field in generated types printed on a new line, set this to true. This can be useful for improving readability of the resulting types, without resorting to running tools like Prettier on the output. Default value: "false"

includeExternalFragments boolean

Whether to include external fragments in the generated code. External fragments are not defined in the same location as the operation definition. Default value: "false"

c-sharp object

This plugin generates C# class identifier for your schema types.

23 nested properties
enumValues object | string

A raw configuration for enumValues map - can be represented with a single string value for a file path, a map between enum name and a file path, or a map between enum name and an object with explicit enum values.

namespaceName string

Allow you to customize the namespace name. Default value: "GraphQLCodeGen"

className string

Allow you to customize the parent class name. Default value: "Types"

listType string

Allow you to customize the list type Default value: "IEnumerable"

emitRecords boolean

Emit C# 9.0+ records instead of classes Default value: "false"

emitJsonAttributes boolean

Should JSON attributes be emitted for produced types and properties ot not Default value: "true"

jsonAttributesSource string
Values: "Newtonsoft.Json" "System.Text.Json"
strictScalars boolean

Makes scalars strict.

If scalars are found in the schema that are not defined in scalars an error will be thrown during codegen. Default value: "false"

defaultScalarType string

Allows you to override the type that unknown scalars will have. Default value: "any"

scalars object | string

Scalars map or a string, a map between the GraphQL scalar name and the identifier that should be used

namingConvention NamingConventionFn_1 | NamingConventionMap_1 | string
typesPrefix string

Prefixes all the generated types. Default value: ""

typesSuffix string

Suffixes all the generated types. Default value: ""

skipTypename boolean

Does not add __typename to the generated types, unless it was specified in the selection set. Default value: "false"

nonOptionalTypename boolean

Automatically adds __typename field to the generated types, even when they are not specified in the selection set, and makes it non-optional Default value: "false"

useTypeImports boolean

Will use import type {} rather than import {} when importing only types. This gives compatibility with TypeScript's "importsNotUsedAsValues": "error" option Default value: "false"

inlineFragmentTypes string

Whether fragment types should be inlined into other operations. "inline" is the default behavior and will perform deep inlining fragment types within operation type definitions. "combine" is the previous behavior that uses fragment type references without inlining the types (and might cause issues with deeply nested fragment that uses list types). "mask" transforms the types for use with fragment masking. Useful when masked types are needed when not using the "client" preset e.g. such as combining it with Apollo Client's data masking feature. Default value: "inline"

emitLegacyCommonJSImports boolean

Emit legacy common js imports. Default it will be true this way it ensure that generated code works with non-compliant bundlers. Default value: "true"

importExtension string[] | string

Append this extension to all imports. Useful for ESM environments that require file extensions in import statements.

extractAllFieldsToTypes boolean

Extract all field types to their own types, instead of inlining them. This helps to reduce type duplication, and makes type errors more readable. It can also significantly reduce the size of the generated code, the generation time, and the typechecking time. Default value: "false"

printFieldsOnNewLines boolean

If you prefer to have each field in generated types printed on a new line, set this to true. This can be useful for improving readability of the resulting types, without resorting to running tools like Prettier on the output. Default value: "false"

includeExternalFragments boolean

Whether to include external fragments in the generated code. External fragments are not defined in the same location as the operation definition. Default value: "false"

memberNameConvention string
Values: "camelCase" "pascalCase"
c-sharp-operations object

This plugin generates C# class based on your GraphQL operations.

39 nested properties
namespaceName string

Allow you to customize the namespace name. Default value: "GraphQLCodeGen"

namedClient string

Defined the global value of namedClient.

querySuffix string

Allows to define a custom suffix for query operations. Default value: "GQL"

mutationSuffix string

Allows to define a custom suffix for mutation operations. Default value: "GQL"

subscriptionSuffix string

Allows to define a custom suffix for Subscription operations. Default value: "GQL"

typesafeOperation boolean

Allows to generate operation methods with class definitions for request/response parameters Default value: "false"

jsonAttributesSource string
Values: "Newtonsoft.Json" "System.Text.Json"
gqlImport string

Customize from which module will gql be imported from. This is useful if you want to use modules other than graphql-tag, e.g. graphql.macro. Default value: "graphql-tag#gql"

documentNodeImport string

Customize from which module will DocumentNode be imported from. This is useful if you want to use modules other than graphql, e.g. @graphql-typed-document-node. Default value: "graphql#DocumentNode"

noExport boolean

Set this configuration to true if you wish to tell codegen to generate code with no export identifier. Default value: "false"

dedupeOperationSuffix boolean

Set this configuration to true if you wish to make sure to remove duplicate operation name suffix. Default value: "false"

omitOperationSuffix boolean

Set this configuration to true if you wish to disable auto add suffix of operation name, like Query, Mutation, Subscription, Fragment. Default value: "false"

operationResultSuffix string

Adds a suffix to generated operation result type names Default value: ""

documentVariablePrefix string

Changes the GraphQL operations variables prefix. Default value: ""

documentVariableSuffix string

Changes the GraphQL operations variables suffix. Default value: "Document"

fragmentVariablePrefix string

Changes the GraphQL fragments variables prefix. Default value: ""

fragmentVariableSuffix string

Changes the GraphQL fragments variables suffix. Default value: "FragmentDoc"

documentMode string
Values: "documentNode" "documentNodeImportFragments" "external" "graphQLTag" "string"
optimizeDocumentNode boolean

If you are using documentMode: documentNode | documentNodeImportFragments, you can set this to true to apply document optimizations for your GraphQL document. This will remove all "loc" and "description" fields from the compiled document, and will remove all empty arrays (such as directives, arguments and variableDefinitions). Default value: "true"

importOperationTypesFrom string

This config is used internally by presets, but you can use it manually to tell codegen to prefix all base types that it's using. This is useful if you wish to generate base types from typescript-operations plugin into a different file, and import it from there. Default value: ""

importDocumentNodeExternallyFrom string

This config should be used if documentMode is external. This has 2 usage:

  • any string: This would be the path to import document nodes from. This can be used if we want to manually create the document nodes e.g. Use graphql-tag in a separate file and export the generated document
  • 'near-operation-file': This is a special mode that is intended to be used with near-operation-file preset to import document nodes from those files. If these files are .graphql files, we make use of webpack loader. Default value: ""
pureMagicComment boolean

This config adds PURE magic comment to the static variables to enforce treeshaking for your bundler. Default value: "false"

experimentalFragmentVariables boolean

If set to true, it will enable support for parsing variables on fragments. Default value: "false"

strictScalars boolean

Makes scalars strict.

If scalars are found in the schema that are not defined in scalars an error will be thrown during codegen. Default value: "false"

defaultScalarType string

Allows you to override the type that unknown scalars will have. Default value: "any"

scalars object | string

Scalars map or a string, a map between the GraphQL scalar name and the identifier that should be used

namingConvention NamingConventionFn_1 | NamingConventionMap_1 | string
typesPrefix string

Prefixes all the generated types. Default value: ""

typesSuffix string

Suffixes all the generated types. Default value: ""

skipTypename boolean

Does not add __typename to the generated types, unless it was specified in the selection set. Default value: "false"

nonOptionalTypename boolean

Automatically adds __typename field to the generated types, even when they are not specified in the selection set, and makes it non-optional Default value: "false"

useTypeImports boolean

Will use import type {} rather than import {} when importing only types. This gives compatibility with TypeScript's "importsNotUsedAsValues": "error" option Default value: "false"

inlineFragmentTypes string

Whether fragment types should be inlined into other operations. "inline" is the default behavior and will perform deep inlining fragment types within operation type definitions. "combine" is the previous behavior that uses fragment type references without inlining the types (and might cause issues with deeply nested fragment that uses list types). "mask" transforms the types for use with fragment masking. Useful when masked types are needed when not using the "client" preset e.g. such as combining it with Apollo Client's data masking feature. Default value: "inline"

emitLegacyCommonJSImports boolean

Emit legacy common js imports. Default it will be true this way it ensure that generated code works with non-compliant bundlers. Default value: "true"

importExtension string[] | string

Append this extension to all imports. Useful for ESM environments that require file extensions in import statements.

extractAllFieldsToTypes boolean

Extract all field types to their own types, instead of inlining them. This helps to reduce type duplication, and makes type errors more readable. It can also significantly reduce the size of the generated code, the generation time, and the typechecking time. Default value: "false"

printFieldsOnNewLines boolean

If you prefer to have each field in generated types printed on a new line, set this to true. This can be useful for improving readability of the resulting types, without resorting to running tools like Prettier on the output. Default value: "false"

includeExternalFragments boolean

Whether to include external fragments in the generated code. External fragments are not defined in the same location as the operation definition. Default value: "false"

memberNameConvention string
Values: "camelCase" "pascalCase"
schema-ast object

This plugin prints the merged schema as string. If multiple schemas are provided, they will be merged and printed as one schema.

5 nested properties
includeDirectives boolean

Include directives to Schema output. Default value: "false"

includeIntrospectionTypes boolean

Include introspection types to Schema output. Default value: "false"

commentDescriptions boolean

Set to true in order to print description as comments (using # instead of """) Default value: "false"

sort boolean

Set to false to disable sorting Default value: "true"

federation boolean
typescript-type-graphql object
41 nested properties
decoratorName __type_16
decorateTypes string[]

Specifies the objects that will have TypeGraphQL decorators prepended to them, by name. Non-matching types will still be output, but without decorators. If not set, all types will be decorated.

avoidOptionals AvoidOptionalsConfig_1 | boolean

This will cause the generator to avoid using TypeScript optionals (?) on types, so the following definition: type A { myField: String } will output myField: Maybe<string> instead of myField?: Maybe<string>. Default value: "false"

constEnums boolean

Will prefix every generated enum with const, you can read more about const enums here: https://www.typescriptlang.org/docs/handbook/enums.html. Default value: "false"

enumsAsTypes boolean

Generates enum as TypeScript string union type instead of an enum. Useful if you wish to generate .d.ts declaration file instead of .ts, or if you want to avoid using TypeScript enums due to bundle size concerns Default value: "false"

numericEnums boolean

Controls whether to preserve typescript enum values as numbers Default value: "false"

futureProofEnums boolean

This option controls whether or not a catch-all entry is added to enum type definitions for values that may be added in the future. This is useful if you are using relay. Default value: "false"

futureProofUnions boolean

This option controls whether or not a catch-all entry is added to union type definitions for values that may be added in the future. This is useful if you are using relay. Default value: "false"

enumsAsConst boolean

Generates enum as TypeScript const assertions instead of enum. This can even be used to enable enum-like patterns in plain JavaScript code if you choose not to use TypeScript’s enum construct. Default value: "false"

onlyEnums boolean

This will cause the generator to emit types for enums only. Default value: "false"

onlyOperationTypes boolean

This will cause the generator to emit types for operations only (basically only enums and scalars). Interacts well with preResolveTypes: true Default value: "false"

immutableTypes boolean

Generates immutable types by adding readonly to properties and uses ReadonlyArray. Default value: "false"

maybeValue string

Allow to override the type value of Maybe. Default value: "T | null"

inputMaybeValue string

Allow to override the type value of Maybe for input types and arguments. This is useful in case you want to differentiate between the wrapper of input and output types. By default, this type just refers to Maybe type, but you can override its definition. Default value: "Maybe"

noExport boolean

Set to true in order to generate output without export modifier. This is useful if you are generating .d.ts file and want it to be globally available. Default value: "false"

disableDescriptions boolean

Set the value to true in order to disable all description generation. Default value: "false"

useImplementingTypes boolean

When a GraphQL interface is used for a field, this flag will use the implementing types, instead of the interface itself. Default value: "false"

wrapEntireFieldDefinitions boolean

Set to true in order to wrap field definitions with EntireFieldWrapper. This is useful to allow return types such as Promises and functions for fields. Differs from wrapFieldDefinitions in that this wraps the entire field definition if i.e. the field is an Array, while wrapFieldDefinitions will wrap every single value inside the array. Default value: "false"

entireFieldWrapperValue string

Allow to override the type value of EntireFieldWrapper. This wrapper applies outside of Array and Maybe unlike fieldWrapperValue, that will wrap the inner type. Default value: "T | Promise | (() => T | Promise)"

allowEnumStringTypes boolean

Allow using enum string values directly.

addUnderscoreToArgsType boolean

Adds _ to generated Args types in order to avoid duplicate identifiers.

enumValues object | string

A raw configuration for enumValues map - can be represented with a single string value for a file path, a map between enum name and a file path, or a map between enum name and an object with explicit enum values.

declarationKind DeclarationKindConfig_1 | string

Overrides the default output for various GraphQL elements.

enumPrefix boolean

Allow you to disable prefixing for generated enums, works in combination with typesPrefix. Default value: "true"

fieldWrapperValue string

Allow you to add wrapper for field type, use T as the generic value. Make sure to set wrapFieldDefinitions to true in order to make this flag work. Default value: "T"

wrapFieldDefinitions boolean

Set to true in order to wrap field definitions with FieldWrapper. This is useful to allow return types such as Promises and functions. Default value: "false"

ignoreEnumValuesFromSchema boolean

This will cause the generator to ignore enum values defined in GraphQLSchema Default value: "false"

directiveArgumentAndInputFieldMappings __type_17
directiveArgumentAndInputFieldMappingTypeSuffix string

Adds a suffix to the imported names to prevent name clashes.

strictScalars boolean

Makes scalars strict.

If scalars are found in the schema that are not defined in scalars an error will be thrown during codegen. Default value: "false"

defaultScalarType string

Allows you to override the type that unknown scalars will have. Default value: "any"

scalars object | string

Scalars map or a string, a map between the GraphQL scalar name and the identifier that should be used

namingConvention NamingConventionFn_2 | NamingConventionMap_2 | string
typesPrefix string

Prefixes all the generated types. Default value: ""

typesSuffix string

Suffixes all the generated types. Default value: ""

skipTypename boolean

Does not add __typename to the generated types, unless it was specified in the selection set. Default value: "false"

nonOptionalTypename boolean

Automatically adds __typename field to the generated types, even when they are not specified in the selection set, and makes it non-optional Default value: "false"

useTypeImports boolean

Will use import type {} rather than import {} when importing only types. This gives compatibility with TypeScript's "importsNotUsedAsValues": "error" option Default value: "false"

dedupeFragments boolean

Removes fragment duplicates for reducing data transfer. It is done by removing sub-fragments imports from fragment definition Instead - all of them are imported to the Operation node. Default value: "false"

inlineFragmentTypes string

Whether fragment types should be inlined into other operations. "inline" is the default behavior and will perform deep inlining fragment types within operation type definitions. "combine" is the previous behavior that uses fragment type references without inlining the types (and might cause issues with deeply nested fragment that uses list types). Default value: "inline"

emitLegacyCommonJSImports boolean

Emit legacy common js imports. Default it will be true this way it ensure that generated code works with non-compliant bundlers. Default value: "true"

typescript-graphql-files-modules object

This plugin generates TypeScript typings for .graphql files containing GraphQL documents, which later on can be consumed using graphql-tag/loader or use string types if you will use the operations as raw strings, and get type-check and type-safety for your imports. This means that any time you import objects from .graphql files, your IDE will provide auto-complete.

This plugin also handles .graphql files containing multiple GraphQL documents, and name the imports according to the operation name.

âš  Fragments are not generated with named imports, only as default imports, due to graphql-tag/loader behavior.

4 nested properties
modulePathPrefix string

Allows specifying a module definition path prefix to provide distinction between generated types. Default value: ""

relativeToCwd boolean

By default, only the filename is being used to generate TS module declarations. Setting this to true will generate it with a full path based on the CWD. Default value: "false"

prefix string

By default, a wildcard is being added as prefix, you can change that to a custom prefix Default value: "*/"

type string

By default, the named exports will have a type DocumentNode. Change this to "string" if you only use raw strings. Default value: "DocumentNode"

Values: "DocumentNode" "string"
named-operations-object object
3 nested properties
identifierName string

Allow you to customize the name of the exported identifier Default value: "namedOperations"

useConsts boolean

Will generate a const string instead of regular string. Default value: "false"

throwOnDuplicate boolean

Throws an error if a duplicate operation name is found. Default value: "false"

typescript-graphql-request object

This plugin generates graphql-request ready-to-use SDK, which is fully-typed.

33 nested properties
rawRequest boolean

By default, the request method return the data or errors key from the response. If you need to access the extensions key you can use the rawRequest method. Default value: "false"

extensionsType string

Allows you to override the type for extensions when rawRequest is enabled. Default value: "any"

gqlImport string

Customize from which module will gql be imported from. This is useful if you want to use modules other than graphql-tag, e.g. graphql.macro. Default value: "graphql-tag#gql"

documentNodeImport string

Customize from which module will DocumentNode be imported from. This is useful if you want to use modules other than graphql, e.g. @graphql-typed-document-node. Default value: "graphql#DocumentNode"

noExport boolean

Set this configuration to true if you wish to tell codegen to generate code with no export identifier. Default value: "false"

dedupeOperationSuffix boolean

Set this configuration to true if you wish to make sure to remove duplicate operation name suffix. Default value: "false"

omitOperationSuffix boolean

Set this configuration to true if you wish to disable auto add suffix of operation name, like Query, Mutation, Subscription, Fragment. Default value: "false"

operationResultSuffix string

Adds a suffix to generated operation result type names Default value: ""

documentVariablePrefix string

Changes the GraphQL operations variables prefix. Default value: ""

documentVariableSuffix string

Changes the GraphQL operations variables suffix. Default value: "Document"

fragmentVariablePrefix string

Changes the GraphQL fragments variables prefix. Default value: ""

fragmentVariableSuffix string

Changes the GraphQL fragments variables suffix. Default value: "FragmentDoc"

documentMode string
Values: "documentNode" "documentNodeImportFragments" "external" "graphQLTag" "string"
optimizeDocumentNode boolean

If you are using documentMode: documentNode | documentNodeImportFragments, you can set this to true to apply document optimizations for your GraphQL document. This will remove all "loc" and "description" fields from the compiled document, and will remove all empty arrays (such as directives, arguments and variableDefinitions). Default value: "true"

importOperationTypesFrom string

This config is used internally by presets, but you can use it manually to tell codegen to prefix all base types that it's using. This is useful if you wish to generate base types from typescript-operations plugin into a different file, and import it from there. Default value: ""

importDocumentNodeExternallyFrom string

This config should be used if documentMode is external. This has 2 usage:

  • any string: This would be the path to import document nodes from. This can be used if we want to manually create the document nodes e.g. Use graphql-tag in a separate file and export the generated document
  • 'near-operation-file': This is a special mode that is intended to be used with near-operation-file preset to import document nodes from those files. If these files are .graphql files, we make use of webpack loader. Default value: ""
pureMagicComment boolean

This config adds PURE magic comment to the static variables to enforce treeshaking for your bundler. Default value: "false"

experimentalFragmentVariables boolean

If set to true, it will enable support for parsing variables on fragments. Default value: "false"

strictScalars boolean

Makes scalars strict.

If scalars are found in the schema that are not defined in scalars an error will be thrown during codegen. Default value: "false"

defaultScalarType string

Allows you to override the type that unknown scalars will have. Default value: "any"

scalars object | string

Scalars map or a string, a map between the GraphQL scalar name and the identifier that should be used

namingConvention NamingConventionFn_1 | NamingConventionMap_1 | string
typesPrefix string

Prefixes all the generated types. Default value: ""

typesSuffix string

Suffixes all the generated types. Default value: ""

skipTypename boolean

Does not add __typename to the generated types, unless it was specified in the selection set. Default value: "false"

nonOptionalTypename boolean

Automatically adds __typename field to the generated types, even when they are not specified in the selection set, and makes it non-optional Default value: "false"

useTypeImports boolean

Will use import type {} rather than import {} when importing only types. This gives compatibility with TypeScript's "importsNotUsedAsValues": "error" option Default value: "false"

inlineFragmentTypes string

Whether fragment types should be inlined into other operations. "inline" is the default behavior and will perform deep inlining fragment types within operation type definitions. "combine" is the previous behavior that uses fragment type references without inlining the types (and might cause issues with deeply nested fragment that uses list types). "mask" transforms the types for use with fragment masking. Useful when masked types are needed when not using the "client" preset e.g. such as combining it with Apollo Client's data masking feature. Default value: "inline"

emitLegacyCommonJSImports boolean

Emit legacy common js imports. Default it will be true this way it ensure that generated code works with non-compliant bundlers. Default value: "true"

importExtension string[] | string

Append this extension to all imports. Useful for ESM environments that require file extensions in import statements.

extractAllFieldsToTypes boolean

Extract all field types to their own types, instead of inlining them. This helps to reduce type duplication, and makes type errors more readable. It can also significantly reduce the size of the generated code, the generation time, and the typechecking time. Default value: "false"

printFieldsOnNewLines boolean

If you prefer to have each field in generated types printed on a new line, set this to true. This can be useful for improving readability of the resulting types, without resorting to running tools like Prettier on the output. Default value: "false"

includeExternalFragments boolean

Whether to include external fragments in the generated code. External fragments are not defined in the same location as the operation definition. Default value: "false"

typescript-mongodb object
21 nested properties
dbTypeSuffix string

Customize the suffix for the generated GraphQL types. Default value: "DbObject"

dbInterfaceSuffix string

Customize the suffix for the generated GraphQL interfaces. Default value: "DbObject"

objectIdType string

Customize the type of _id fields. You can either specify a type name, or specify module#type. Default value: "mongodb#ObjectId"

idFieldName string

Customize the name of the id field generated after using @id directive over a GraphQL field. Default value: "_id"

enumsAsString boolean

Replaces generated enum values with string. Default value: "true"

avoidOptionals boolean

This will cause the generator to avoid using TypeScript optionals (?), so the following definition: type A { myField: String } will output myField: Maybe<string> instead of myField?: Maybe<string>. Default value: "false"

strictScalars boolean

Makes scalars strict.

If scalars are found in the schema that are not defined in scalars an error will be thrown during codegen. Default value: "false"

defaultScalarType string

Allows you to override the type that unknown scalars will have. Default value: "any"

scalars object | string

Scalars map or a string, a map between the GraphQL scalar name and the identifier that should be used

namingConvention NamingConventionFn_1 | NamingConventionMap_1 | string
typesPrefix string

Prefixes all the generated types. Default value: ""

typesSuffix string

Suffixes all the generated types. Default value: ""

skipTypename boolean

Does not add __typename to the generated types, unless it was specified in the selection set. Default value: "false"

nonOptionalTypename boolean

Automatically adds __typename field to the generated types, even when they are not specified in the selection set, and makes it non-optional Default value: "false"

useTypeImports boolean

Will use import type {} rather than import {} when importing only types. This gives compatibility with TypeScript's "importsNotUsedAsValues": "error" option Default value: "false"

inlineFragmentTypes string

Whether fragment types should be inlined into other operations. "inline" is the default behavior and will perform deep inlining fragment types within operation type definitions. "combine" is the previous behavior that uses fragment type references without inlining the types (and might cause issues with deeply nested fragment that uses list types). "mask" transforms the types for use with fragment masking. Useful when masked types are needed when not using the "client" preset e.g. such as combining it with Apollo Client's data masking feature. Default value: "inline"

emitLegacyCommonJSImports boolean

Emit legacy common js imports. Default it will be true this way it ensure that generated code works with non-compliant bundlers. Default value: "true"

importExtension string[] | string

Append this extension to all imports. Useful for ESM environments that require file extensions in import statements.

extractAllFieldsToTypes boolean

Extract all field types to their own types, instead of inlining them. This helps to reduce type duplication, and makes type errors more readable. It can also significantly reduce the size of the generated code, the generation time, and the typechecking time. Default value: "false"

printFieldsOnNewLines boolean

If you prefer to have each field in generated types printed on a new line, set this to true. This can be useful for improving readability of the resulting types, without resorting to running tools like Prettier on the output. Default value: "false"

includeExternalFragments boolean

Whether to include external fragments in the generated code. External fragments are not defined in the same location as the operation definition. Default value: "false"

typescript-resolvers object

This plugin generates TypeScript signature for resolve functions of your GraphQL API. You can use this plugin to generate simple resolvers signature based on your GraphQL types, or you can change its behavior be providing custom model types (mappers).

You can find a blog post explaining the usage of this plugin here: https://the-guild.dev/blog/better-type-safety-for-resolvers-with-graphql-codegen

49 nested properties
useIndexSignature boolean

Adds an index signature to any generates resolver. Default value: "false"

noSchemaStitching boolean

Disables/Enables Schema Stitching support. By default, the resolver signature does not include the support for schema-stitching. Set to false to enable that. Default value: "true"

wrapFieldDefinitions boolean

Set to true in order to wrap field definitions with FieldWrapper. This is useful to allow return types such as Promises and functions. Needed for compatibility with federation: true when Default value: "true"

customResolveInfo string

You can provide your custom GraphQLResolveInfo instead of the default one from graphql-js Default value: "graphql#GraphQLResolveInfo"

customResolverFn string

You can provide your custom ResolveFn instead the default. It has to be a type that uses the generics <TResult, TParent, TContext, TArgs> Default value: "(parent: TParent, args: TArgs, context: TContext, info: GraphQLResolveInfo) => Promise | TResult"

directiveResolverMappings __type_1
allowParentTypeOverride boolean

Allow you to override the ParentType generic in each resolver, by avoid enforcing the base type of the generated generic type.

This will generate ParentType = Type instead of ParentType extends Type = Type in each resolver.

optionalInfoArgument boolean

Sets info argument of resolver function to be optional field. Useful for testing.

makeResolverTypeCallable boolean

Set to true in order to allow the Resolver type to be callable

addUnderscoreToArgsType boolean

Adds _ to generated Args types in order to avoid duplicate identifiers.

contextType string

Use this configuration to set a custom type for your context, and it will affect all the resolvers, without the need to override it using generics each time. If you wish to use an external type and import it from another file, you can use add plugin and add the required import statement, or you can use a module#type syntax.

fieldContextTypes string[]
rootValueType string

Use this configuration to set a custom type for the rootValue, and it will affect resolvers of all root types (Query, Mutation and Subscription), without the need to override it using generics each time. If you wish to use an external type and import it from another file, you can use add plugin and add the required import statement, or you can use both module#type or module#namespace#type syntax.

directiveContextTypes string[]
mapperTypeSuffix string

Adds a suffix to the imported names to prevent name clashes.

mappers Record<string, string>

Replaces a GraphQL type usage with a custom type, allowing you to return custom object from your resolvers. You can use both module#type and module#namespace#type syntax.

defaultMapper string

Allow you to set the default mapper when it's not being override by mappers or generics. You can specify a type name, or specify a string in module#type or module#namespace#type format. The default value of mappers is the TypeScript type generated by typescript package.

avoidOptionals AvoidOptionalsConfig | boolean

This will cause the generator to avoid using optionals (?), so all field resolvers must be implemented in order to avoid compilation errors. Default value: "false"

showUnusedMappers boolean

Warns about unused mappers. Default value: "true"

enumValues object | string

A raw configuration for enumValues map - can be represented with a single string value for a file path, a map between enum name and a file path, or a map between enum name and an object with explicit enum values.

resolverTypeWrapperSignature string

Allow you to override resolverTypeWrapper definition. Default value: "Promise | T"

federation boolean

Supports Apollo Federation Default value: "false"

enumPrefix boolean

Allow you to disable prefixing for generated enums, works in combination with typesPrefix. Default value: "true"

enumSuffix boolean

Allow you to disable suffixing for generated enums, works in combination with typesSuffix. Default value: "true"

customDirectives object

Configures behavior for custom directives from various GraphQL libraries.

1 nested properties
semanticNonNull boolean
optionalResolveType boolean

Sets the __resolveType field as optional field. Default value: "false"

immutableTypes boolean

Generates immutable types by adding readonly to properties and uses ReadonlyArray. Default value: "false"

namespacedImportName string

Prefixes all GraphQL related generated types with that value, as namespaces import. You can use this feature to allow separation of plugins to different files. Default value: "''"

resolverTypeSuffix string

Suffix we add to each generated type resolver. Default value: "Resolvers"

allResolversTypeName string

The type name to use when exporting all resolvers signature as unified type. Default value: "Resolvers"

internalResolversPrefix string

Defines the prefix value used for __resolveType and __isTypeOf resolvers. If you are using mercurius-js, please set this field to empty string for better compatibility. Default value: "'__'"

resolversNonOptionalTypename ResolversNonOptionalTypenameConfig | boolean

Makes __typename of resolver mappings non-optional without affecting the base types. Default value: "false"

avoidCheckingAbstractTypesRecursively boolean

If true, recursively goes through all object type's fields, checks if they have abstract types and generates expected types correctly. This may not work for cases where provided default mapper types are also nested e.g. defaultMapper: DeepPartial<{T}> or defaultMapper: Partial<{T}>. Default value: "false"

addInterfaceFieldResolverTypes boolean

If true, add field resolver types to Interfaces. By default, GraphQL Interfaces do not trigger any field resolvers, meaning every implementing type must implement the same resolver for the shared fields.

Some tools provide a way to change the default behaviour by making GraphQL Objects inherit missing resolvers from their Interface types. In these cases, it is fine to turn this option to true.

For example, if you are using @graphql-tools/schema#makeExecutableSchema with inheritResolversFromInterfaces: true, you can make addInterfaceFieldResolverTypes: true as well https://the-guild.dev/graphql/tools/docs/generate-schema#makeexecutableschema Default value: "false"

strictScalars boolean

Makes scalars strict.

If scalars are found in the schema that are not defined in scalars an error will be thrown during codegen. Default value: "false"

defaultScalarType string

Allows you to override the type that unknown scalars will have. Default value: "any"

scalars object | string

Scalars map or a string, a map between the GraphQL scalar name and the identifier that should be used

namingConvention NamingConventionFn_1 | NamingConventionMap_1 | string
typesPrefix string

Prefixes all the generated types. Default value: ""

typesSuffix string

Suffixes all the generated types. Default value: ""

skipTypename boolean

Does not add __typename to the generated types, unless it was specified in the selection set. Default value: "false"

nonOptionalTypename boolean

Automatically adds __typename field to the generated types, even when they are not specified in the selection set, and makes it non-optional Default value: "false"

useTypeImports boolean

Will use import type {} rather than import {} when importing only types. This gives compatibility with TypeScript's "importsNotUsedAsValues": "error" option Default value: "false"

inlineFragmentTypes string

Whether fragment types should be inlined into other operations. "inline" is the default behavior and will perform deep inlining fragment types within operation type definitions. "combine" is the previous behavior that uses fragment type references without inlining the types (and might cause issues with deeply nested fragment that uses list types). "mask" transforms the types for use with fragment masking. Useful when masked types are needed when not using the "client" preset e.g. such as combining it with Apollo Client's data masking feature. Default value: "inline"

emitLegacyCommonJSImports boolean

Emit legacy common js imports. Default it will be true this way it ensure that generated code works with non-compliant bundlers. Default value: "true"

importExtension string[] | string

Append this extension to all imports. Useful for ESM environments that require file extensions in import statements.

extractAllFieldsToTypes boolean

Extract all field types to their own types, instead of inlining them. This helps to reduce type duplication, and makes type errors more readable. It can also significantly reduce the size of the generated code, the generation time, and the typechecking time. Default value: "false"

printFieldsOnNewLines boolean

If you prefer to have each field in generated types printed on a new line, set this to true. This can be useful for improving readability of the resulting types, without resorting to running tools like Prettier on the output. Default value: "false"

includeExternalFragments boolean

Whether to include external fragments in the generated code. External fragments are not defined in the same location as the operation definition. Default value: "false"

typescript-apollo-angular object

This plugin generates Apollo services (Query, Mutation and Subscription) with TypeScript typings.

It will generate a strongly typed Angular service for every defined query, mutation or subscription. The generated Angular services are ready to inject and use within your Angular component.

It extends the basic TypeScript plugins: @graphql-codegen/typescript, @graphql-codegen/typescript-operations - and thus shares a similar configuration.

To shed some more light regards this template, it's recommended to go through this article: https://apollo-angular.com/docs/get-started, and to read the Code Generation with Apollo Angular: https://the-guild.dev/blog/apollo-angular-12

44 nested properties
apolloAngularVersion number

Version of apollo-angular package Default value: "2"

ngModule string

Allows to define ngModule as part of the plugin's config so it's globally available.

namedClient string

Defined the global value of namedClient.

serviceName string

Defined the global value of serviceName.

serviceProvidedInRoot boolean

Defined the global value of serviceProvidedInRoot.

serviceProvidedIn string

Define the Injector of the SDK class.

sdkClass boolean

Set to true in order to generate a SDK service class that uses all generated services. Default value: "false"

querySuffix string

Allows to define a custom suffix for query operations. Default value: "GQL"

mutationSuffix string

Allows to define a custom suffix for mutation operations. Default value: "GQL"

subscriptionSuffix string

Allows to define a custom suffix for Subscription operations. Default value: "GQL"

apolloAngularPackage string

Allows to define a custom Apollo-Angular package to import types from. Default value: "'apollo-angular'"

additionalDI string[]

Add additional dependency injections for generated services Default value: ""

addExplicitOverride boolean

Add override modifier to make the generated code compatible with the noImplicitOverride option of Typescript v4.3+. Default value: "false"

gqlImport string

Customize from which module will gql be imported from. This is useful if you want to use modules other than graphql-tag, e.g. graphql.macro. Default value: "graphql-tag#gql"

documentNodeImport string

Customize from which module will DocumentNode be imported from. This is useful if you want to use modules other than graphql, e.g. @graphql-typed-document-node. Default value: "graphql#DocumentNode"

noExport boolean

Set this configuration to true if you wish to tell codegen to generate code with no export identifier. Default value: "false"

dedupeOperationSuffix boolean

Set this configuration to true if you wish to make sure to remove duplicate operation name suffix. Default value: "false"

omitOperationSuffix boolean

Set this configuration to true if you wish to disable auto add suffix of operation name, like Query, Mutation, Subscription, Fragment. Default value: "false"

operationResultSuffix string

Adds a suffix to generated operation result type names Default value: ""

documentVariablePrefix string

Changes the GraphQL operations variables prefix. Default value: ""

documentVariableSuffix string

Changes the GraphQL operations variables suffix. Default value: "Document"

fragmentVariablePrefix string

Changes the GraphQL fragments variables prefix. Default value: ""

fragmentVariableSuffix string

Changes the GraphQL fragments variables suffix. Default value: "FragmentDoc"

documentMode string
Values: "documentNode" "documentNodeImportFragments" "external" "graphQLTag" "string"
optimizeDocumentNode boolean

If you are using documentMode: documentNode | documentNodeImportFragments, you can set this to true to apply document optimizations for your GraphQL document. This will remove all "loc" and "description" fields from the compiled document, and will remove all empty arrays (such as directives, arguments and variableDefinitions). Default value: "true"

importOperationTypesFrom string

This config is used internally by presets, but you can use it manually to tell codegen to prefix all base types that it's using. This is useful if you wish to generate base types from typescript-operations plugin into a different file, and import it from there. Default value: ""

importDocumentNodeExternallyFrom string

This config should be used if documentMode is external. This has 2 usage:

  • any string: This would be the path to import document nodes from. This can be used if we want to manually create the document nodes e.g. Use graphql-tag in a separate file and export the generated document
  • 'near-operation-file': This is a special mode that is intended to be used with near-operation-file preset to import document nodes from those files. If these files are .graphql files, we make use of webpack loader. Default value: ""
pureMagicComment boolean

This config adds PURE magic comment to the static variables to enforce treeshaking for your bundler. Default value: "false"

experimentalFragmentVariables boolean

If set to true, it will enable support for parsing variables on fragments. Default value: "false"

strictScalars boolean

Makes scalars strict.

If scalars are found in the schema that are not defined in scalars an error will be thrown during codegen. Default value: "false"

defaultScalarType string

Allows you to override the type that unknown scalars will have. Default value: "any"

scalars object | string

Scalars map or a string, a map between the GraphQL scalar name and the identifier that should be used

namingConvention NamingConventionFn_1 | NamingConventionMap_1 | string
typesPrefix string

Prefixes all the generated types. Default value: ""

typesSuffix string

Suffixes all the generated types. Default value: ""

skipTypename boolean

Does not add __typename to the generated types, unless it was specified in the selection set. Default value: "false"

nonOptionalTypename boolean

Automatically adds __typename field to the generated types, even when they are not specified in the selection set, and makes it non-optional Default value: "false"

useTypeImports boolean

Will use import type {} rather than import {} when importing only types. This gives compatibility with TypeScript's "importsNotUsedAsValues": "error" option Default value: "false"

inlineFragmentTypes string

Whether fragment types should be inlined into other operations. "inline" is the default behavior and will perform deep inlining fragment types within operation type definitions. "combine" is the previous behavior that uses fragment type references without inlining the types (and might cause issues with deeply nested fragment that uses list types). "mask" transforms the types for use with fragment masking. Useful when masked types are needed when not using the "client" preset e.g. such as combining it with Apollo Client's data masking feature. Default value: "inline"

emitLegacyCommonJSImports boolean

Emit legacy common js imports. Default it will be true this way it ensure that generated code works with non-compliant bundlers. Default value: "true"

importExtension string[] | string

Append this extension to all imports. Useful for ESM environments that require file extensions in import statements.

extractAllFieldsToTypes boolean

Extract all field types to their own types, instead of inlining them. This helps to reduce type duplication, and makes type errors more readable. It can also significantly reduce the size of the generated code, the generation time, and the typechecking time. Default value: "false"

printFieldsOnNewLines boolean

If you prefer to have each field in generated types printed on a new line, set this to true. This can be useful for improving readability of the resulting types, without resorting to running tools like Prettier on the output. Default value: "false"

includeExternalFragments boolean

Whether to include external fragments in the generated code. External fragments are not defined in the same location as the operation definition. Default value: "false"

typescript-nhost object

This plugin generates the Typescript schema that enables queries and mutations to be typed in the Nhost SDK.

1 nested properties
scalars object | string

Scalars map or a string, a map between the GraphQL scalar name and the identifier that should be used

typescript-urql object

This plugin generates urql (https://github.com/FormidableLabs/urql) components and HOC with TypeScript typings.

34 nested properties
withComponent boolean

Customized the output by enabling/disabling the generated Component. Default value: "false"

withHooks boolean

Customized the output by enabling/disabling the generated React Hooks. Default value: "true"

urqlImportFrom string

You can specify module that exports components Query, Mutation, Subscription and HOCs This is useful for further abstraction of some common tasks (e.g. error handling). Filepath relative to generated file can be also specified. Default value: "urql"

gqlImport string

Customize from which module will gql be imported from. This is useful if you want to use modules other than graphql-tag, e.g. graphql.macro. Default value: "graphql-tag#gql"

documentNodeImport string

Customize from which module will DocumentNode be imported from. This is useful if you want to use modules other than graphql, e.g. @graphql-typed-document-node. Default value: "graphql#DocumentNode"

noExport boolean

Set this configuration to true if you wish to tell codegen to generate code with no export identifier. Default value: "false"

dedupeOperationSuffix boolean

Set this configuration to true if you wish to make sure to remove duplicate operation name suffix. Default value: "false"

omitOperationSuffix boolean

Set this configuration to true if you wish to disable auto add suffix of operation name, like Query, Mutation, Subscription, Fragment. Default value: "false"

operationResultSuffix string

Adds a suffix to generated operation result type names Default value: ""

documentVariablePrefix string

Changes the GraphQL operations variables prefix. Default value: ""

documentVariableSuffix string

Changes the GraphQL operations variables suffix. Default value: "Document"

fragmentVariablePrefix string

Changes the GraphQL fragments variables prefix. Default value: ""

fragmentVariableSuffix string

Changes the GraphQL fragments variables suffix. Default value: "FragmentDoc"

documentMode string
Values: "documentNode" "documentNodeImportFragments" "external" "graphQLTag" "string"
optimizeDocumentNode boolean

If you are using documentMode: documentNode | documentNodeImportFragments, you can set this to true to apply document optimizations for your GraphQL document. This will remove all "loc" and "description" fields from the compiled document, and will remove all empty arrays (such as directives, arguments and variableDefinitions). Default value: "true"

importOperationTypesFrom string

This config is used internally by presets, but you can use it manually to tell codegen to prefix all base types that it's using. This is useful if you wish to generate base types from typescript-operations plugin into a different file, and import it from there. Default value: ""

importDocumentNodeExternallyFrom string

This config should be used if documentMode is external. This has 2 usage:

  • any string: This would be the path to import document nodes from. This can be used if we want to manually create the document nodes e.g. Use graphql-tag in a separate file and export the generated document
  • 'near-operation-file': This is a special mode that is intended to be used with near-operation-file preset to import document nodes from those files. If these files are .graphql files, we make use of webpack loader. Default value: ""
pureMagicComment boolean

This config adds PURE magic comment to the static variables to enforce treeshaking for your bundler. Default value: "false"

experimentalFragmentVariables boolean

If set to true, it will enable support for parsing variables on fragments. Default value: "false"

strictScalars boolean

Makes scalars strict.

If scalars are found in the schema that are not defined in scalars an error will be thrown during codegen. Default value: "false"

defaultScalarType string

Allows you to override the type that unknown scalars will have. Default value: "any"

scalars object | string

Scalars map or a string, a map between the GraphQL scalar name and the identifier that should be used

namingConvention NamingConventionFn_1 | NamingConventionMap_1 | string
typesPrefix string

Prefixes all the generated types. Default value: ""

typesSuffix string

Suffixes all the generated types. Default value: ""

skipTypename boolean

Does not add __typename to the generated types, unless it was specified in the selection set. Default value: "false"

nonOptionalTypename boolean

Automatically adds __typename field to the generated types, even when they are not specified in the selection set, and makes it non-optional Default value: "false"

useTypeImports boolean

Will use import type {} rather than import {} when importing only types. This gives compatibility with TypeScript's "importsNotUsedAsValues": "error" option Default value: "false"

inlineFragmentTypes string

Whether fragment types should be inlined into other operations. "inline" is the default behavior and will perform deep inlining fragment types within operation type definitions. "combine" is the previous behavior that uses fragment type references without inlining the types (and might cause issues with deeply nested fragment that uses list types). "mask" transforms the types for use with fragment masking. Useful when masked types are needed when not using the "client" preset e.g. such as combining it with Apollo Client's data masking feature. Default value: "inline"

emitLegacyCommonJSImports boolean

Emit legacy common js imports. Default it will be true this way it ensure that generated code works with non-compliant bundlers. Default value: "true"

importExtension string[] | string

Append this extension to all imports. Useful for ESM environments that require file extensions in import statements.

extractAllFieldsToTypes boolean

Extract all field types to their own types, instead of inlining them. This helps to reduce type duplication, and makes type errors more readable. It can also significantly reduce the size of the generated code, the generation time, and the typechecking time. Default value: "false"

printFieldsOnNewLines boolean

If you prefer to have each field in generated types printed on a new line, set this to true. This can be useful for improving readability of the resulting types, without resorting to running tools like Prettier on the output. Default value: "false"

includeExternalFragments boolean

Whether to include external fragments in the generated code. External fragments are not defined in the same location as the operation definition. Default value: "false"

typescript-react-apollo object

This plugin generates React Apollo components and HOC with TypeScript typings.

It extends the basic TypeScript plugins: @graphql-codegen/typescript, @graphql-codegen/typescript-operations - and thus shares a similar configuration.

48 nested properties
withComponent boolean

Customize the output by enabling/disabling the generated Component (deprecated since Apollo-Client v3). For more details: https://apollographql.com/docs/react/api/react/components Default value: "false"

withHOC boolean

Customize the output by enabling/disabling the HOC (deprecated since Apollo-Client v3). For more details: https://apollographql.com/docs/react/api/react/hoc Default value: "false"

withHooks boolean

Customized the output by enabling/disabling the generated React Hooks. For more details: https://apollographql.com/docs/react/api/react/hooks Default value: "true"

withMutationFn boolean

Customized the output by enabling/disabling the generated mutation function signature. Default value: "true"

withRefetchFn boolean

Enable generating a function to be used with refetchQueries Default value: "false"

apolloReactCommonImportFrom string

Customize the package where apollo-react common lib is loaded from. Default value: "@apollo/react-common"

apolloReactComponentsImportFrom string

Customize the package where apollo-react component lib is loaded from. Default value: "@apollo/react-components"

apolloReactHocImportFrom string

Customize the package where apollo-react HOC lib is loaded from. Default value: "@apollo/react-hoc"

apolloReactHooksImportFrom string

Customize the package where apollo-react hooks lib is loaded from. Default value: "@apollo/react-hooks"

componentSuffix string

You can specify a suffix that gets attached to the name of the generated component. Default value: "Component"

reactApolloVersion number

Sets the version of react-apollo. If you are using the old (deprecated) package of react-apollo, please set this configuration to 2. If you are using Apollo-Client v3, please set this to 3. Default value: "3"

Values: 2 3
withResultType boolean

Customized the output by enabling/disabling the generated result type. Default value: "true"

withMutationOptionsType boolean

Customized the output by enabling/disabling the generated mutation option type. Default value: "true"

withFragmentHooks boolean

Whether or not to include wrappers for Apollo's useFragment hook. Default value: "false"

addDocBlocks boolean

Allows you to enable/disable the generation of docblocks in generated code. Some IDE's (like VSCode) add extra inline information with docblocks, you can disable this feature if your preferred IDE does not. Default value: "true"

defaultBaseOptions Record<string, any>
7 nested properties
awaitRefetchQueries boolean
errorPolicy string
fetchPolicy string
ignoreResults boolean
notifyOnNetworkStatusChange boolean
returnPartialData boolean
ssr boolean
hooksSuffix string
gqlImport string

Customize from which module will gql be imported from. This is useful if you want to use modules other than graphql-tag, e.g. graphql.macro. Default value: "graphql-tag#gql"

documentNodeImport string

Customize from which module will DocumentNode be imported from. This is useful if you want to use modules other than graphql, e.g. @graphql-typed-document-node. Default value: "graphql#DocumentNode"

noExport boolean

Set this configuration to true if you wish to tell codegen to generate code with no export identifier. Default value: "false"

dedupeOperationSuffix boolean

Set this configuration to true if you wish to make sure to remove duplicate operation name suffix. Default value: "false"

omitOperationSuffix boolean

Set this configuration to true if you wish to disable auto add suffix of operation name, like Query, Mutation, Subscription, Fragment. Default value: "false"

operationResultSuffix string

Adds a suffix to generated operation result type names Default value: ""

documentVariablePrefix string

Changes the GraphQL operations variables prefix. Default value: ""

documentVariableSuffix string

Changes the GraphQL operations variables suffix. Default value: "Document"

fragmentVariablePrefix string

Changes the GraphQL fragments variables prefix. Default value: ""

fragmentVariableSuffix string

Changes the GraphQL fragments variables suffix. Default value: "FragmentDoc"

documentMode string
Values: "documentNode" "documentNodeImportFragments" "external" "graphQLTag" "string"
optimizeDocumentNode boolean

If you are using documentMode: documentNode | documentNodeImportFragments, you can set this to true to apply document optimizations for your GraphQL document. This will remove all "loc" and "description" fields from the compiled document, and will remove all empty arrays (such as directives, arguments and variableDefinitions). Default value: "true"

importOperationTypesFrom string

This config is used internally by presets, but you can use it manually to tell codegen to prefix all base types that it's using. This is useful if you wish to generate base types from typescript-operations plugin into a different file, and import it from there. Default value: ""

importDocumentNodeExternallyFrom string

This config should be used if documentMode is external. This has 2 usage:

  • any string: This would be the path to import document nodes from. This can be used if we want to manually create the document nodes e.g. Use graphql-tag in a separate file and export the generated document
  • 'near-operation-file': This is a special mode that is intended to be used with near-operation-file preset to import document nodes from those files. If these files are .graphql files, we make use of webpack loader. Default value: ""
pureMagicComment boolean

This config adds PURE magic comment to the static variables to enforce treeshaking for your bundler. Default value: "false"

experimentalFragmentVariables boolean

If set to true, it will enable support for parsing variables on fragments. Default value: "false"

strictScalars boolean

Makes scalars strict.

If scalars are found in the schema that are not defined in scalars an error will be thrown during codegen. Default value: "false"

defaultScalarType string

Allows you to override the type that unknown scalars will have. Default value: "any"

scalars object | string

Scalars map or a string, a map between the GraphQL scalar name and the identifier that should be used

namingConvention NamingConventionFn_1 | NamingConventionMap_1 | string
typesPrefix string

Prefixes all the generated types. Default value: ""

typesSuffix string

Suffixes all the generated types. Default value: ""

skipTypename boolean

Does not add __typename to the generated types, unless it was specified in the selection set. Default value: "false"

nonOptionalTypename boolean

Automatically adds __typename field to the generated types, even when they are not specified in the selection set, and makes it non-optional Default value: "false"

useTypeImports boolean

Will use import type {} rather than import {} when importing only types. This gives compatibility with TypeScript's "importsNotUsedAsValues": "error" option Default value: "false"

inlineFragmentTypes string

Whether fragment types should be inlined into other operations. "inline" is the default behavior and will perform deep inlining fragment types within operation type definitions. "combine" is the previous behavior that uses fragment type references without inlining the types (and might cause issues with deeply nested fragment that uses list types). "mask" transforms the types for use with fragment masking. Useful when masked types are needed when not using the "client" preset e.g. such as combining it with Apollo Client's data masking feature. Default value: "inline"

emitLegacyCommonJSImports boolean

Emit legacy common js imports. Default it will be true this way it ensure that generated code works with non-compliant bundlers. Default value: "true"

importExtension string[] | string

Append this extension to all imports. Useful for ESM environments that require file extensions in import statements.

extractAllFieldsToTypes boolean

Extract all field types to their own types, instead of inlining them. This helps to reduce type duplication, and makes type errors more readable. It can also significantly reduce the size of the generated code, the generation time, and the typechecking time. Default value: "false"

printFieldsOnNewLines boolean

If you prefer to have each field in generated types printed on a new line, set this to true. This can be useful for improving readability of the resulting types, without resorting to running tools like Prettier on the output. Default value: "false"

includeExternalFragments boolean

Whether to include external fragments in the generated code. External fragments are not defined in the same location as the operation definition. Default value: "false"

typescript-vue-apollo object

This plugin generates

36 nested properties
withCompositionFunctions boolean

Customized the output by enabling/disabling the generated Vue composition functions. Default value: "true"

vueApolloComposableImportFrom string

Default value: ""

vueCompositionApiImportFrom string

Default value: ""

addDocBlocks boolean

Allows you to enable/disable the generation of docblocks in generated code. Some IDE's (like VSCode) add extra inline information with docblocks, you can disable this feature if your preferred IDE does not. Default value: "true"

clientId string

Allows you to set the clientId in the composition functions when using multiple apollo clients. Default value: "null"

gqlImport string

Customize from which module will gql be imported from. This is useful if you want to use modules other than graphql-tag, e.g. graphql.macro. Default value: "graphql-tag#gql"

documentNodeImport string

Customize from which module will DocumentNode be imported from. This is useful if you want to use modules other than graphql, e.g. @graphql-typed-document-node. Default value: "graphql#DocumentNode"

noExport boolean

Set this configuration to true if you wish to tell codegen to generate code with no export identifier. Default value: "false"

dedupeOperationSuffix boolean

Set this configuration to true if you wish to make sure to remove duplicate operation name suffix. Default value: "false"

omitOperationSuffix boolean

Set this configuration to true if you wish to disable auto add suffix of operation name, like Query, Mutation, Subscription, Fragment. Default value: "false"

operationResultSuffix string

Adds a suffix to generated operation result type names Default value: ""

documentVariablePrefix string

Changes the GraphQL operations variables prefix. Default value: ""

documentVariableSuffix string

Changes the GraphQL operations variables suffix. Default value: "Document"

fragmentVariablePrefix string

Changes the GraphQL fragments variables prefix. Default value: ""

fragmentVariableSuffix string

Changes the GraphQL fragments variables suffix. Default value: "FragmentDoc"

documentMode string
Values: "documentNode" "documentNodeImportFragments" "external" "graphQLTag" "string"
optimizeDocumentNode boolean

If you are using documentMode: documentNode | documentNodeImportFragments, you can set this to true to apply document optimizations for your GraphQL document. This will remove all "loc" and "description" fields from the compiled document, and will remove all empty arrays (such as directives, arguments and variableDefinitions). Default value: "true"

importOperationTypesFrom string

This config is used internally by presets, but you can use it manually to tell codegen to prefix all base types that it's using. This is useful if you wish to generate base types from typescript-operations plugin into a different file, and import it from there. Default value: ""

importDocumentNodeExternallyFrom string

This config should be used if documentMode is external. This has 2 usage:

  • any string: This would be the path to import document nodes from. This can be used if we want to manually create the document nodes e.g. Use graphql-tag in a separate file and export the generated document
  • 'near-operation-file': This is a special mode that is intended to be used with near-operation-file preset to import document nodes from those files. If these files are .graphql files, we make use of webpack loader. Default value: ""
pureMagicComment boolean

This config adds PURE magic comment to the static variables to enforce treeshaking for your bundler. Default value: "false"

experimentalFragmentVariables boolean

If set to true, it will enable support for parsing variables on fragments. Default value: "false"

strictScalars boolean

Makes scalars strict.

If scalars are found in the schema that are not defined in scalars an error will be thrown during codegen. Default value: "false"

defaultScalarType string

Allows you to override the type that unknown scalars will have. Default value: "any"

scalars object | string

Scalars map or a string, a map between the GraphQL scalar name and the identifier that should be used

namingConvention NamingConventionFn_1 | NamingConventionMap_1 | string
typesPrefix string

Prefixes all the generated types. Default value: ""

typesSuffix string

Suffixes all the generated types. Default value: ""

skipTypename boolean

Does not add __typename to the generated types, unless it was specified in the selection set. Default value: "false"

nonOptionalTypename boolean

Automatically adds __typename field to the generated types, even when they are not specified in the selection set, and makes it non-optional Default value: "false"

useTypeImports boolean

Will use import type {} rather than import {} when importing only types. This gives compatibility with TypeScript's "importsNotUsedAsValues": "error" option Default value: "false"

inlineFragmentTypes string

Whether fragment types should be inlined into other operations. "inline" is the default behavior and will perform deep inlining fragment types within operation type definitions. "combine" is the previous behavior that uses fragment type references without inlining the types (and might cause issues with deeply nested fragment that uses list types). "mask" transforms the types for use with fragment masking. Useful when masked types are needed when not using the "client" preset e.g. such as combining it with Apollo Client's data masking feature. Default value: "inline"

emitLegacyCommonJSImports boolean

Emit legacy common js imports. Default it will be true this way it ensure that generated code works with non-compliant bundlers. Default value: "true"

importExtension string[] | string

Append this extension to all imports. Useful for ESM environments that require file extensions in import statements.

extractAllFieldsToTypes boolean

Extract all field types to their own types, instead of inlining them. This helps to reduce type duplication, and makes type errors more readable. It can also significantly reduce the size of the generated code, the generation time, and the typechecking time. Default value: "false"

printFieldsOnNewLines boolean

If you prefer to have each field in generated types printed on a new line, set this to true. This can be useful for improving readability of the resulting types, without resorting to running tools like Prettier on the output. Default value: "false"

includeExternalFragments boolean

Whether to include external fragments in the generated code. External fragments are not defined in the same location as the operation definition. Default value: "false"

typescript-vue-apollo-smart-ops object

This plugin generates Vue Apollo Smart Query, Smart Subscription and mutation operation functions with TypeScript typings.

This plugin relies on some helper functions and types from the vue-apollo-smart-ops package. That package also adds some optional functionality for improved error handling in Vue Apollo operations which can be configured in the generated code from this plugin.

It extends the basic TypeScript plugins: @graphql-codegen/typescript, @graphql-codegen/typescript-operations - and thus shares a similar configuration.

40 nested properties
withSmartOperationFunctions boolean

Customize the output by enabling/disabling the generated Vue Apollo Smart Operations functions. Default value: "true"

vueApolloOperationFunctionsImportFrom string

The typescript-vue-apollo-smart-ops plugin requires three functions that are used to define your query, subscription and mutation operation functions:

  • createMutationFunction
  • createSmartQueryOptionsFunction
  • createSmartSubscriptionOptionsFunction

By default, these functions are provided by the vue-apollo-smart-ops package, but you can substitute your own import path if you want to replace them with other implementations. Default value: "vue-apollo-smart-ops"

vueApolloErrorType string

The operation functions generated by typescript-vue-apollo-smart-ops include some functionality for error handling. This configuration parameter allows you to customise the name of the error type that will be used. The default is to use ApolloError from the apollo-client package. Default value: "ApolloError"

vueApolloErrorTypeImportFrom string

The operation functions generated by typescript-vue-apollo-smart-ops include some functionality for error handling. This configuration parameter allows you to customise the package where the error type will be imported from. The default is to use ApolloError from the apollo-client package. Default value: "vue-apollo-smart-ops"

vueApolloErrorHandlerFunction string

The operation functions generated by typescript-vue-apollo-smart-ops include some functionality for error handling. You may supply an error handler function that will be called when an error occurs in a query, subscription or mutation operation. This function should implement the ApolloOperationErrorHandlerFunction interface from vue-apollo-smart-ops package. You can have a custom handler in your app that shows a notification to the user, for example. If unspecified, this functionality will be disabled and errors handled (or not) by Vue Apollo in the normal way. Default value: "undefined"

vueApolloErrorHandlerFunctionImportFrom string

The import path where vueApolloErrorHandlerFunction should be imported from. Can be a package name or a local file path (anything that works in an import statement). Default value: "undefined"

vueAppType string

The operation functions generated by typescript-vue-apollo-smart-ops include some functionality for error handling. When an error occurs, the Vue app instance is passed to the error handler. You can customise the expected type of the app object. For example, a Nuxt.js app might use NuxtApp from @nuxt/types/app instead. When unspecified, the default type is Vue from vue/types/vue. Default value: "undefined"

vueAppTypeImportFrom string

The import path where vueAppType should be imported from. Can be a package name or a local file path (anything that works in an import statement). Default value: "undefined"

addDocBlocks boolean

Allows you to enable/disable the generation of docblocks in generated code. Some IDE's (like VSCode) add extra inline information with docblocks, you can disable this feature if your preferred IDE does not. Default value: "true"

gqlImport string

Customize from which module will gql be imported from. This is useful if you want to use modules other than graphql-tag, e.g. graphql.macro. Default value: "graphql-tag#gql"

documentNodeImport string

Customize from which module will DocumentNode be imported from. This is useful if you want to use modules other than graphql, e.g. @graphql-typed-document-node. Default value: "graphql#DocumentNode"

noExport boolean

Set this configuration to true if you wish to tell codegen to generate code with no export identifier. Default value: "false"

dedupeOperationSuffix boolean

Set this configuration to true if you wish to make sure to remove duplicate operation name suffix. Default value: "false"

omitOperationSuffix boolean

Set this configuration to true if you wish to disable auto add suffix of operation name, like Query, Mutation, Subscription, Fragment. Default value: "false"

operationResultSuffix string

Adds a suffix to generated operation result type names Default value: ""

documentVariablePrefix string

Changes the GraphQL operations variables prefix. Default value: ""

documentVariableSuffix string

Changes the GraphQL operations variables suffix. Default value: "Document"

fragmentVariablePrefix string

Changes the GraphQL fragments variables prefix. Default value: ""

fragmentVariableSuffix string

Changes the GraphQL fragments variables suffix. Default value: "FragmentDoc"

documentMode string
Values: "documentNode" "documentNodeImportFragments" "external" "graphQLTag" "string"
optimizeDocumentNode boolean

If you are using documentMode: documentNode | documentNodeImportFragments, you can set this to true to apply document optimizations for your GraphQL document. This will remove all "loc" and "description" fields from the compiled document, and will remove all empty arrays (such as directives, arguments and variableDefinitions). Default value: "true"

importOperationTypesFrom string

This config is used internally by presets, but you can use it manually to tell codegen to prefix all base types that it's using. This is useful if you wish to generate base types from typescript-operations plugin into a different file, and import it from there. Default value: ""

importDocumentNodeExternallyFrom string

This config should be used if documentMode is external. This has 2 usage:

  • any string: This would be the path to import document nodes from. This can be used if we want to manually create the document nodes e.g. Use graphql-tag in a separate file and export the generated document
  • 'near-operation-file': This is a special mode that is intended to be used with near-operation-file preset to import document nodes from those files. If these files are .graphql files, we make use of webpack loader. Default value: ""
pureMagicComment boolean

This config adds PURE magic comment to the static variables to enforce treeshaking for your bundler. Default value: "false"

experimentalFragmentVariables boolean

If set to true, it will enable support for parsing variables on fragments. Default value: "false"

strictScalars boolean

Makes scalars strict.

If scalars are found in the schema that are not defined in scalars an error will be thrown during codegen. Default value: "false"

defaultScalarType string

Allows you to override the type that unknown scalars will have. Default value: "any"

scalars object | string

Scalars map or a string, a map between the GraphQL scalar name and the identifier that should be used

namingConvention NamingConventionFn_1 | NamingConventionMap_1 | string
typesPrefix string

Prefixes all the generated types. Default value: ""

typesSuffix string

Suffixes all the generated types. Default value: ""

skipTypename boolean

Does not add __typename to the generated types, unless it was specified in the selection set. Default value: "false"

nonOptionalTypename boolean

Automatically adds __typename field to the generated types, even when they are not specified in the selection set, and makes it non-optional Default value: "false"

useTypeImports boolean

Will use import type {} rather than import {} when importing only types. This gives compatibility with TypeScript's "importsNotUsedAsValues": "error" option Default value: "false"

inlineFragmentTypes string

Whether fragment types should be inlined into other operations. "inline" is the default behavior and will perform deep inlining fragment types within operation type definitions. "combine" is the previous behavior that uses fragment type references without inlining the types (and might cause issues with deeply nested fragment that uses list types). "mask" transforms the types for use with fragment masking. Useful when masked types are needed when not using the "client" preset e.g. such as combining it with Apollo Client's data masking feature. Default value: "inline"

emitLegacyCommonJSImports boolean

Emit legacy common js imports. Default it will be true this way it ensure that generated code works with non-compliant bundlers. Default value: "true"

importExtension string[] | string

Append this extension to all imports. Useful for ESM environments that require file extensions in import statements.

extractAllFieldsToTypes boolean

Extract all field types to their own types, instead of inlining them. This helps to reduce type duplication, and makes type errors more readable. It can also significantly reduce the size of the generated code, the generation time, and the typechecking time. Default value: "false"

printFieldsOnNewLines boolean

If you prefer to have each field in generated types printed on a new line, set this to true. This can be useful for improving readability of the resulting types, without resorting to running tools like Prettier on the output. Default value: "false"

includeExternalFragments boolean

Whether to include external fragments in the generated code. External fragments are not defined in the same location as the operation definition. Default value: "false"

typescript-vue-urql object

This plugin generates urql (https://github.com/FormidableLabs/urql) composition functions with TypeScript typings.

33 nested properties
withComposition boolean

Customized the output by enabling/disabling the generated Vue Composition functions. Default value: "true"

urqlImportFrom string

You can specify module that exports components Query, Mutation, Subscription This is useful for further abstraction of some common tasks (e.g. error handling). Filepath relative to generated file can be also specified. Default value: "urql"

gqlImport string

Customize from which module will gql be imported from. This is useful if you want to use modules other than graphql-tag, e.g. graphql.macro. Default value: "graphql-tag#gql"

documentNodeImport string

Customize from which module will DocumentNode be imported from. This is useful if you want to use modules other than graphql, e.g. @graphql-typed-document-node. Default value: "graphql#DocumentNode"

noExport boolean

Set this configuration to true if you wish to tell codegen to generate code with no export identifier. Default value: "false"

dedupeOperationSuffix boolean

Set this configuration to true if you wish to make sure to remove duplicate operation name suffix. Default value: "false"

omitOperationSuffix boolean

Set this configuration to true if you wish to disable auto add suffix of operation name, like Query, Mutation, Subscription, Fragment. Default value: "false"

operationResultSuffix string

Adds a suffix to generated operation result type names Default value: ""

documentVariablePrefix string

Changes the GraphQL operations variables prefix. Default value: ""

documentVariableSuffix string

Changes the GraphQL operations variables suffix. Default value: "Document"

fragmentVariablePrefix string

Changes the GraphQL fragments variables prefix. Default value: ""

fragmentVariableSuffix string

Changes the GraphQL fragments variables suffix. Default value: "FragmentDoc"

documentMode string
Values: "documentNode" "documentNodeImportFragments" "external" "graphQLTag" "string"
optimizeDocumentNode boolean

If you are using documentMode: documentNode | documentNodeImportFragments, you can set this to true to apply document optimizations for your GraphQL document. This will remove all "loc" and "description" fields from the compiled document, and will remove all empty arrays (such as directives, arguments and variableDefinitions). Default value: "true"

importOperationTypesFrom string

This config is used internally by presets, but you can use it manually to tell codegen to prefix all base types that it's using. This is useful if you wish to generate base types from typescript-operations plugin into a different file, and import it from there. Default value: ""

importDocumentNodeExternallyFrom string

This config should be used if documentMode is external. This has 2 usage:

  • any string: This would be the path to import document nodes from. This can be used if we want to manually create the document nodes e.g. Use graphql-tag in a separate file and export the generated document
  • 'near-operation-file': This is a special mode that is intended to be used with near-operation-file preset to import document nodes from those files. If these files are .graphql files, we make use of webpack loader. Default value: ""
pureMagicComment boolean

This config adds PURE magic comment to the static variables to enforce treeshaking for your bundler. Default value: "false"

experimentalFragmentVariables boolean

If set to true, it will enable support for parsing variables on fragments. Default value: "false"

strictScalars boolean

Makes scalars strict.

If scalars are found in the schema that are not defined in scalars an error will be thrown during codegen. Default value: "false"

defaultScalarType string

Allows you to override the type that unknown scalars will have. Default value: "any"

scalars object | string

Scalars map or a string, a map between the GraphQL scalar name and the identifier that should be used

namingConvention NamingConventionFn_1 | NamingConventionMap_1 | string
typesPrefix string

Prefixes all the generated types. Default value: ""

typesSuffix string

Suffixes all the generated types. Default value: ""

skipTypename boolean

Does not add __typename to the generated types, unless it was specified in the selection set. Default value: "false"

nonOptionalTypename boolean

Automatically adds __typename field to the generated types, even when they are not specified in the selection set, and makes it non-optional Default value: "false"

useTypeImports boolean

Will use import type {} rather than import {} when importing only types. This gives compatibility with TypeScript's "importsNotUsedAsValues": "error" option Default value: "false"

inlineFragmentTypes string

Whether fragment types should be inlined into other operations. "inline" is the default behavior and will perform deep inlining fragment types within operation type definitions. "combine" is the previous behavior that uses fragment type references without inlining the types (and might cause issues with deeply nested fragment that uses list types). "mask" transforms the types for use with fragment masking. Useful when masked types are needed when not using the "client" preset e.g. such as combining it with Apollo Client's data masking feature. Default value: "inline"

emitLegacyCommonJSImports boolean

Emit legacy common js imports. Default it will be true this way it ensure that generated code works with non-compliant bundlers. Default value: "true"

importExtension string[] | string

Append this extension to all imports. Useful for ESM environments that require file extensions in import statements.

extractAllFieldsToTypes boolean

Extract all field types to their own types, instead of inlining them. This helps to reduce type duplication, and makes type errors more readable. It can also significantly reduce the size of the generated code, the generation time, and the typechecking time. Default value: "false"

printFieldsOnNewLines boolean

If you prefer to have each field in generated types printed on a new line, set this to true. This can be useful for improving readability of the resulting types, without resorting to running tools like Prettier on the output. Default value: "false"

includeExternalFragments boolean

Whether to include external fragments in the generated code. External fragments are not defined in the same location as the operation definition. Default value: "false"

typescript-stencil-apollo object

This plugin generates Stencil Apollo functional components typings

It extends the basic TypeScript plugins: @graphql-codegen/typescript, @graphql-codegen/typescript-operations - and thus shares a similar configuration.

32 nested properties
componentType string
Values: "class" "functional"
gqlImport string

Customize from which module will gql be imported from. This is useful if you want to use modules other than graphql-tag, e.g. graphql.macro. Default value: "graphql-tag#gql"

documentNodeImport string

Customize from which module will DocumentNode be imported from. This is useful if you want to use modules other than graphql, e.g. @graphql-typed-document-node. Default value: "graphql#DocumentNode"

noExport boolean

Set this configuration to true if you wish to tell codegen to generate code with no export identifier. Default value: "false"

dedupeOperationSuffix boolean

Set this configuration to true if you wish to make sure to remove duplicate operation name suffix. Default value: "false"

omitOperationSuffix boolean

Set this configuration to true if you wish to disable auto add suffix of operation name, like Query, Mutation, Subscription, Fragment. Default value: "false"

operationResultSuffix string

Adds a suffix to generated operation result type names Default value: ""

documentVariablePrefix string

Changes the GraphQL operations variables prefix. Default value: ""

documentVariableSuffix string

Changes the GraphQL operations variables suffix. Default value: "Document"

fragmentVariablePrefix string

Changes the GraphQL fragments variables prefix. Default value: ""

fragmentVariableSuffix string

Changes the GraphQL fragments variables suffix. Default value: "FragmentDoc"

documentMode string
Values: "documentNode" "documentNodeImportFragments" "external" "graphQLTag" "string"
optimizeDocumentNode boolean

If you are using documentMode: documentNode | documentNodeImportFragments, you can set this to true to apply document optimizations for your GraphQL document. This will remove all "loc" and "description" fields from the compiled document, and will remove all empty arrays (such as directives, arguments and variableDefinitions). Default value: "true"

importOperationTypesFrom string

This config is used internally by presets, but you can use it manually to tell codegen to prefix all base types that it's using. This is useful if you wish to generate base types from typescript-operations plugin into a different file, and import it from there. Default value: ""

importDocumentNodeExternallyFrom string

This config should be used if documentMode is external. This has 2 usage:

  • any string: This would be the path to import document nodes from. This can be used if we want to manually create the document nodes e.g. Use graphql-tag in a separate file and export the generated document
  • 'near-operation-file': This is a special mode that is intended to be used with near-operation-file preset to import document nodes from those files. If these files are .graphql files, we make use of webpack loader. Default value: ""
pureMagicComment boolean

This config adds PURE magic comment to the static variables to enforce treeshaking for your bundler. Default value: "false"

experimentalFragmentVariables boolean

If set to true, it will enable support for parsing variables on fragments. Default value: "false"

strictScalars boolean

Makes scalars strict.

If scalars are found in the schema that are not defined in scalars an error will be thrown during codegen. Default value: "false"

defaultScalarType string

Allows you to override the type that unknown scalars will have. Default value: "any"

scalars object | string

Scalars map or a string, a map between the GraphQL scalar name and the identifier that should be used

namingConvention NamingConventionFn_1 | NamingConventionMap_1 | string
typesPrefix string

Prefixes all the generated types. Default value: ""

typesSuffix string

Suffixes all the generated types. Default value: ""

skipTypename boolean

Does not add __typename to the generated types, unless it was specified in the selection set. Default value: "false"

nonOptionalTypename boolean

Automatically adds __typename field to the generated types, even when they are not specified in the selection set, and makes it non-optional Default value: "false"

useTypeImports boolean

Will use import type {} rather than import {} when importing only types. This gives compatibility with TypeScript's "importsNotUsedAsValues": "error" option Default value: "false"

inlineFragmentTypes string

Whether fragment types should be inlined into other operations. "inline" is the default behavior and will perform deep inlining fragment types within operation type definitions. "combine" is the previous behavior that uses fragment type references without inlining the types (and might cause issues with deeply nested fragment that uses list types). "mask" transforms the types for use with fragment masking. Useful when masked types are needed when not using the "client" preset e.g. such as combining it with Apollo Client's data masking feature. Default value: "inline"

emitLegacyCommonJSImports boolean

Emit legacy common js imports. Default it will be true this way it ensure that generated code works with non-compliant bundlers. Default value: "true"

importExtension string[] | string

Append this extension to all imports. Useful for ESM environments that require file extensions in import statements.

extractAllFieldsToTypes boolean

Extract all field types to their own types, instead of inlining them. This helps to reduce type duplication, and makes type errors more readable. It can also significantly reduce the size of the generated code, the generation time, and the typechecking time. Default value: "false"

printFieldsOnNewLines boolean

If you prefer to have each field in generated types printed on a new line, set this to true. This can be useful for improving readability of the resulting types, without resorting to running tools like Prettier on the output. Default value: "false"

includeExternalFragments boolean

Whether to include external fragments in the generated code. External fragments are not defined in the same location as the operation definition. Default value: "false"

typescript-document-nodes object

This plugin generates TypeScript source .ts file from GraphQL files .graphql.

35 nested properties
namingConvention NamingConventionFn_1 | NamingConventionMap_1 | string
namePrefix string

Adds prefix to the name Default value: ""

nameSuffix string

Adds suffix to the name Default value: ""

fragmentPrefix string

Adds prefix to the fragment variable Default value: ""

fragmentSuffix string

Adds suffix to the fragment variable Default value: ""

gqlImport string

Customize from which module will gql be imported from. This is useful if you want to use modules other than graphql-tag, e.g. graphql.macro. Default value: "graphql-tag#gql"

documentNodeImport string

Customize from which module will DocumentNode be imported from. This is useful if you want to use modules other than graphql, e.g. @graphql-typed-document-node. Default value: "graphql#DocumentNode"

noExport boolean

Set this configuration to true if you wish to tell codegen to generate code with no export identifier. Default value: "false"

dedupeOperationSuffix boolean

Set this configuration to true if you wish to make sure to remove duplicate operation name suffix. Default value: "false"

omitOperationSuffix boolean

Set this configuration to true if you wish to disable auto add suffix of operation name, like Query, Mutation, Subscription, Fragment. Default value: "false"

operationResultSuffix string

Adds a suffix to generated operation result type names Default value: ""

documentVariablePrefix string

Changes the GraphQL operations variables prefix. Default value: ""

documentVariableSuffix string

Changes the GraphQL operations variables suffix. Default value: "Document"

fragmentVariablePrefix string

Changes the GraphQL fragments variables prefix. Default value: ""

fragmentVariableSuffix string

Changes the GraphQL fragments variables suffix. Default value: "FragmentDoc"

documentMode string
Values: "documentNode" "documentNodeImportFragments" "external" "graphQLTag" "string"
optimizeDocumentNode boolean

If you are using documentMode: documentNode | documentNodeImportFragments, you can set this to true to apply document optimizations for your GraphQL document. This will remove all "loc" and "description" fields from the compiled document, and will remove all empty arrays (such as directives, arguments and variableDefinitions). Default value: "true"

importOperationTypesFrom string

This config is used internally by presets, but you can use it manually to tell codegen to prefix all base types that it's using. This is useful if you wish to generate base types from typescript-operations plugin into a different file, and import it from there. Default value: ""

importDocumentNodeExternallyFrom string

This config should be used if documentMode is external. This has 2 usage:

  • any string: This would be the path to import document nodes from. This can be used if we want to manually create the document nodes e.g. Use graphql-tag in a separate file and export the generated document
  • 'near-operation-file': This is a special mode that is intended to be used with near-operation-file preset to import document nodes from those files. If these files are .graphql files, we make use of webpack loader. Default value: ""
pureMagicComment boolean

This config adds PURE magic comment to the static variables to enforce treeshaking for your bundler. Default value: "false"

experimentalFragmentVariables boolean

If set to true, it will enable support for parsing variables on fragments. Default value: "false"

strictScalars boolean

Makes scalars strict.

If scalars are found in the schema that are not defined in scalars an error will be thrown during codegen. Default value: "false"

defaultScalarType string

Allows you to override the type that unknown scalars will have. Default value: "any"

scalars object | string

Scalars map or a string, a map between the GraphQL scalar name and the identifier that should be used

typesPrefix string

Prefixes all the generated types. Default value: ""

typesSuffix string

Suffixes all the generated types. Default value: ""

skipTypename boolean

Does not add __typename to the generated types, unless it was specified in the selection set. Default value: "false"

nonOptionalTypename boolean

Automatically adds __typename field to the generated types, even when they are not specified in the selection set, and makes it non-optional Default value: "false"

useTypeImports boolean

Will use import type {} rather than import {} when importing only types. This gives compatibility with TypeScript's "importsNotUsedAsValues": "error" option Default value: "false"

inlineFragmentTypes string

Whether fragment types should be inlined into other operations. "inline" is the default behavior and will perform deep inlining fragment types within operation type definitions. "combine" is the previous behavior that uses fragment type references without inlining the types (and might cause issues with deeply nested fragment that uses list types). "mask" transforms the types for use with fragment masking. Useful when masked types are needed when not using the "client" preset e.g. such as combining it with Apollo Client's data masking feature. Default value: "inline"

emitLegacyCommonJSImports boolean

Emit legacy common js imports. Default it will be true this way it ensure that generated code works with non-compliant bundlers. Default value: "true"

importExtension string[] | string

Append this extension to all imports. Useful for ESM environments that require file extensions in import statements.

extractAllFieldsToTypes boolean

Extract all field types to their own types, instead of inlining them. This helps to reduce type duplication, and makes type errors more readable. It can also significantly reduce the size of the generated code, the generation time, and the typechecking time. Default value: "false"

printFieldsOnNewLines boolean

If you prefer to have each field in generated types printed on a new line, set this to true. This can be useful for improving readability of the resulting types, without resorting to running tools like Prettier on the output. Default value: "false"

includeExternalFragments boolean

Whether to include external fragments in the generated code. External fragments are not defined in the same location as the operation definition. Default value: "false"

typescript-msw object

This plugin generates msw (https://github.com/mswjs/msw) mock handlers with TypeScript typings.

1 nested properties
link object

GraphQL endpoint to use when working with multiple backends.

3 nested properties
endpoint string
name string
withSuffix boolean
java-apollo-android object

This plugin and presets creates generated mappers and parsers for a complete type-safe GraphQL requests, for developers that uses Apollo Android runtime.

19 nested properties
package string

Customize the Java package name for the generated operations. The default package name will be generated according to the output file path.

typePackage string

Customize the Java package name for the types generated based on input types.

fragmentPackage string

Customize the Java package name for the fragments generated classes.

fileType number
Values: 0 1 2 3
strictScalars boolean

Makes scalars strict.

If scalars are found in the schema that are not defined in scalars an error will be thrown during codegen. Default value: "false"

defaultScalarType string

Allows you to override the type that unknown scalars will have. Default value: "any"

scalars object | string

Scalars map or a string, a map between the GraphQL scalar name and the identifier that should be used

namingConvention NamingConventionFn_1 | NamingConventionMap_1 | string
typesPrefix string

Prefixes all the generated types. Default value: ""

typesSuffix string

Suffixes all the generated types. Default value: ""

skipTypename boolean

Does not add __typename to the generated types, unless it was specified in the selection set. Default value: "false"

nonOptionalTypename boolean

Automatically adds __typename field to the generated types, even when they are not specified in the selection set, and makes it non-optional Default value: "false"

useTypeImports boolean

Will use import type {} rather than import {} when importing only types. This gives compatibility with TypeScript's "importsNotUsedAsValues": "error" option Default value: "false"

inlineFragmentTypes string

Whether fragment types should be inlined into other operations. "inline" is the default behavior and will perform deep inlining fragment types within operation type definitions. "combine" is the previous behavior that uses fragment type references without inlining the types (and might cause issues with deeply nested fragment that uses list types). "mask" transforms the types for use with fragment masking. Useful when masked types are needed when not using the "client" preset e.g. such as combining it with Apollo Client's data masking feature. Default value: "inline"

emitLegacyCommonJSImports boolean

Emit legacy common js imports. Default it will be true this way it ensure that generated code works with non-compliant bundlers. Default value: "true"

importExtension string[] | string

Append this extension to all imports. Useful for ESM environments that require file extensions in import statements.

extractAllFieldsToTypes boolean

Extract all field types to their own types, instead of inlining them. This helps to reduce type duplication, and makes type errors more readable. It can also significantly reduce the size of the generated code, the generation time, and the typechecking time. Default value: "false"

printFieldsOnNewLines boolean

If you prefer to have each field in generated types printed on a new line, set this to true. This can be useful for improving readability of the resulting types, without resorting to running tools like Prettier on the output. Default value: "false"

includeExternalFragments boolean

Whether to include external fragments in the generated code. External fragments are not defined in the same location as the operation definition. Default value: "false"

java-resolvers object
20 nested properties
package string

Customize the Java package name. The default package name will be generated according to the output file path.

mappers Record<string, string>

Allow you to replace specific GraphQL types with your custom model classes. This is useful when you want to make sure your resolvers returns the correct class. The default value is the values set by defaultMapper configuration. You can use a direct path to the package, or use package#class syntax to have it imported.

defaultMapper string

Sets the default mapper value in case it's not specified by mappers. You can use a direct path to the package, or use package#class syntax to have it imported. The default mapper is Java's Object. Default value: "Object"

className string

Allow you to customize the parent class name. Default value: "Resolvers"

listType string

Allow you to customize the list type. Default value: "Iterable"

strictScalars boolean

Makes scalars strict.

If scalars are found in the schema that are not defined in scalars an error will be thrown during codegen. Default value: "false"

defaultScalarType string

Allows you to override the type that unknown scalars will have. Default value: "any"

scalars object | string

Scalars map or a string, a map between the GraphQL scalar name and the identifier that should be used

namingConvention NamingConventionFn_1 | NamingConventionMap_1 | string
typesPrefix string

Prefixes all the generated types. Default value: ""

typesSuffix string

Suffixes all the generated types. Default value: ""

skipTypename boolean

Does not add __typename to the generated types, unless it was specified in the selection set. Default value: "false"

nonOptionalTypename boolean

Automatically adds __typename field to the generated types, even when they are not specified in the selection set, and makes it non-optional Default value: "false"

useTypeImports boolean

Will use import type {} rather than import {} when importing only types. This gives compatibility with TypeScript's "importsNotUsedAsValues": "error" option Default value: "false"

inlineFragmentTypes string

Whether fragment types should be inlined into other operations. "inline" is the default behavior and will perform deep inlining fragment types within operation type definitions. "combine" is the previous behavior that uses fragment type references without inlining the types (and might cause issues with deeply nested fragment that uses list types). "mask" transforms the types for use with fragment masking. Useful when masked types are needed when not using the "client" preset e.g. such as combining it with Apollo Client's data masking feature. Default value: "inline"

emitLegacyCommonJSImports boolean

Emit legacy common js imports. Default it will be true this way it ensure that generated code works with non-compliant bundlers. Default value: "true"

importExtension string[] | string

Append this extension to all imports. Useful for ESM environments that require file extensions in import statements.

extractAllFieldsToTypes boolean

Extract all field types to their own types, instead of inlining them. This helps to reduce type duplication, and makes type errors more readable. It can also significantly reduce the size of the generated code, the generation time, and the typechecking time. Default value: "false"

printFieldsOnNewLines boolean

If you prefer to have each field in generated types printed on a new line, set this to true. This can be useful for improving readability of the resulting types, without resorting to running tools like Prettier on the output. Default value: "false"

includeExternalFragments boolean

Whether to include external fragments in the generated code. External fragments are not defined in the same location as the operation definition. Default value: "false"

java object
20 nested properties
package string

Customize the Java package name. The default package name will be generated according to the output file path.

mappers Record<string, string>

Allow you to replace specific GraphQL types with your custom model classes. This is useful when you want to make sure your resolvers returns the correct class. The default value is the values set by defaultMapper configuration. You can use a direct path to the package, or use package#class syntax to have it imported.

defaultMapper string

Sets the default mapper value in case it's not specified by mappers. You can use a direct path to the package, or use package#class syntax to have it imported. The default mapper is Java's Object. Default value: "Object"

className string

Allow you to customize the parent class name. Default value: "Resolvers"

listType string

Allow you to customize the list type. Default value: "Iterable"

strictScalars boolean

Makes scalars strict.

If scalars are found in the schema that are not defined in scalars an error will be thrown during codegen. Default value: "false"

defaultScalarType string

Allows you to override the type that unknown scalars will have. Default value: "any"

scalars object | string

Scalars map or a string, a map between the GraphQL scalar name and the identifier that should be used

namingConvention NamingConventionFn_1 | NamingConventionMap_1 | string
typesPrefix string

Prefixes all the generated types. Default value: ""

typesSuffix string

Suffixes all the generated types. Default value: ""

skipTypename boolean

Does not add __typename to the generated types, unless it was specified in the selection set. Default value: "false"

nonOptionalTypename boolean

Automatically adds __typename field to the generated types, even when they are not specified in the selection set, and makes it non-optional Default value: "false"

useTypeImports boolean

Will use import type {} rather than import {} when importing only types. This gives compatibility with TypeScript's "importsNotUsedAsValues": "error" option Default value: "false"

inlineFragmentTypes string

Whether fragment types should be inlined into other operations. "inline" is the default behavior and will perform deep inlining fragment types within operation type definitions. "combine" is the previous behavior that uses fragment type references without inlining the types (and might cause issues with deeply nested fragment that uses list types). "mask" transforms the types for use with fragment masking. Useful when masked types are needed when not using the "client" preset e.g. such as combining it with Apollo Client's data masking feature. Default value: "inline"

emitLegacyCommonJSImports boolean

Emit legacy common js imports. Default it will be true this way it ensure that generated code works with non-compliant bundlers. Default value: "true"

importExtension string[] | string

Append this extension to all imports. Useful for ESM environments that require file extensions in import statements.

extractAllFieldsToTypes boolean

Extract all field types to their own types, instead of inlining them. This helps to reduce type duplication, and makes type errors more readable. It can also significantly reduce the size of the generated code, the generation time, and the typechecking time. Default value: "false"

printFieldsOnNewLines boolean

If you prefer to have each field in generated types printed on a new line, set this to true. This can be useful for improving readability of the resulting types, without resorting to running tools like Prettier on the output. Default value: "false"

includeExternalFragments boolean

Whether to include external fragments in the generated code. External fragments are not defined in the same location as the operation definition. Default value: "false"

kotlin object
20 nested properties
package string

Customize the Java package name. The default package name will be generated according to the output file path.

enumValues object | string

A raw configuration for enumValues map - can be represented with a single string value for a file path, a map between enum name and a file path, or a map between enum name and an object with explicit enum values.

listType string

Allow you to customize the list type Default value: "Iterable"

withTypes boolean

Allow you to enable generation for the types Default value: "false"

omitJvmStatic boolean

Allow you to omit JvmStatic annotation Default value: "false"

strictScalars boolean

Makes scalars strict.

If scalars are found in the schema that are not defined in scalars an error will be thrown during codegen. Default value: "false"

defaultScalarType string

Allows you to override the type that unknown scalars will have. Default value: "any"

scalars object | string

Scalars map or a string, a map between the GraphQL scalar name and the identifier that should be used

namingConvention NamingConventionFn_1 | NamingConventionMap_1 | string
typesPrefix string

Prefixes all the generated types. Default value: ""

typesSuffix string

Suffixes all the generated types. Default value: ""

skipTypename boolean

Does not add __typename to the generated types, unless it was specified in the selection set. Default value: "false"

nonOptionalTypename boolean

Automatically adds __typename field to the generated types, even when they are not specified in the selection set, and makes it non-optional Default value: "false"

useTypeImports boolean

Will use import type {} rather than import {} when importing only types. This gives compatibility with TypeScript's "importsNotUsedAsValues": "error" option Default value: "false"

inlineFragmentTypes string

Whether fragment types should be inlined into other operations. "inline" is the default behavior and will perform deep inlining fragment types within operation type definitions. "combine" is the previous behavior that uses fragment type references without inlining the types (and might cause issues with deeply nested fragment that uses list types). "mask" transforms the types for use with fragment masking. Useful when masked types are needed when not using the "client" preset e.g. such as combining it with Apollo Client's data masking feature. Default value: "inline"

emitLegacyCommonJSImports boolean

Emit legacy common js imports. Default it will be true this way it ensure that generated code works with non-compliant bundlers. Default value: "true"

importExtension string[] | string

Append this extension to all imports. Useful for ESM environments that require file extensions in import statements.

extractAllFieldsToTypes boolean

Extract all field types to their own types, instead of inlining them. This helps to reduce type duplication, and makes type errors more readable. It can also significantly reduce the size of the generated code, the generation time, and the typechecking time. Default value: "false"

printFieldsOnNewLines boolean

If you prefer to have each field in generated types printed on a new line, set this to true. This can be useful for improving readability of the resulting types, without resorting to running tools like Prettier on the output. Default value: "false"

includeExternalFragments boolean

Whether to include external fragments in the generated code. External fragments are not defined in the same location as the operation definition. Default value: "false"

flow object

This plugin generates Flow types based on your GraphQLSchema.

It generates types for your entire schema: types, input types, enum, interface, scalar and union.

27 nested properties
useFlowExactObjects boolean

Generates Flow types as Exact types. Default value: "true"

useFlowReadOnlyTypes boolean

Generates read-only Flow types Default value: "false"

addUnderscoreToArgsType boolean

Adds _ to generated Args types in order to avoid duplicate identifiers.

enumValues object | string

A raw configuration for enumValues map - can be represented with a single string value for a file path, a map between enum name and a file path, or a map between enum name and an object with explicit enum values.

declarationKind DeclarationKindConfig_1 | string

Overrides the default output for various GraphQL elements.

enumPrefix boolean

Allow you to disable prefixing for generated enums, works in combination with typesPrefix. Default value: "true"

fieldWrapperValue string

Allow you to add wrapper for field type, use T as the generic value. Make sure to set wrapFieldDefinitions to true in order to make this flag work. Default value: "T"

wrapFieldDefinitions boolean

Set to true in order to wrap field definitions with FieldWrapper. This is useful to allow return types such as Promises and functions. Default value: "false"

onlyEnums boolean

This will cause the generator to emit types for enums only Default value: "false"

onlyOperationTypes boolean

This will cause the generator to emit types for operations only (basically only enums and scalars) Default value: "false"

ignoreEnumValuesFromSchema boolean

This will cause the generator to ignore enum values defined in GraphQLSchema Default value: "false"

wrapEntireFieldDefinitions boolean

Set to true in order to wrap field definitions with EntireFieldWrapper. This is useful to allow return types such as Promises and functions for fields. Differs from wrapFieldDefinitions in that this wraps the entire field definition if i.e. the field is an Array, while wrapFieldDefinitions will wrap every single value inside the array. Default value: "true"

entireFieldWrapperValue string

Allow to override the type value of EntireFieldWrapper. This wrapper applies outside of Array and Maybe unlike fieldWrapperValue, that will wrap the inner type. Default value: "T | Promise | (() => T | Promise)"

directiveArgumentAndInputFieldMappings __type_17
directiveArgumentAndInputFieldMappingTypeSuffix string

Adds a suffix to the imported names to prevent name clashes.

strictScalars boolean

Makes scalars strict.

If scalars are found in the schema that are not defined in scalars an error will be thrown during codegen. Default value: "false"

defaultScalarType string

Allows you to override the type that unknown scalars will have. Default value: "any"

scalars object | string

Scalars map or a string, a map between the GraphQL scalar name and the identifier that should be used

namingConvention NamingConventionFn_2 | NamingConventionMap_2 | string
typesPrefix string

Prefixes all the generated types. Default value: ""

typesSuffix string

Suffixes all the generated types. Default value: ""

skipTypename boolean

Does not add __typename to the generated types, unless it was specified in the selection set. Default value: "false"

nonOptionalTypename boolean

Automatically adds __typename field to the generated types, even when they are not specified in the selection set, and makes it non-optional Default value: "false"

useTypeImports boolean

Will use import type {} rather than import {} when importing only types. This gives compatibility with TypeScript's "importsNotUsedAsValues": "error" option Default value: "false"

dedupeFragments boolean

Removes fragment duplicates for reducing data transfer. It is done by removing sub-fragments imports from fragment definition Instead - all of them are imported to the Operation node. Default value: "false"

inlineFragmentTypes string

Whether fragment types should be inlined into other operations. "inline" is the default behavior and will perform deep inlining fragment types within operation type definitions. "combine" is the previous behavior that uses fragment type references without inlining the types (and might cause issues with deeply nested fragment that uses list types). Default value: "inline"

emitLegacyCommonJSImports boolean

Emit legacy common js imports. Default it will be true this way it ensure that generated code works with non-compliant bundlers. Default value: "true"

flow-resolvers object

This plugin generates resolvers signature based on your GraphQLSchema.

It generates types for your entire schema: types, input types, enum, interface, scalar and union.

This plugin requires you to use @graphql-codegen/flow as well, because it depends on it's types.

33 nested properties
addUnderscoreToArgsType boolean

Adds _ to generated Args types in order to avoid duplicate identifiers.

contextType string

Use this configuration to set a custom type for your context, and it will affect all the resolvers, without the need to override it using generics each time. If you wish to use an external type and import it from another file, you can use add plugin and add the required import statement, or you can use a module#type syntax.

fieldContextTypes string[]
rootValueType string

Use this configuration to set a custom type for the rootValue, and it will affect resolvers of all root types (Query, Mutation and Subscription), without the need to override it using generics each time. If you wish to use an external type and import it from another file, you can use add plugin and add the required import statement, or you can use both module#type or module#namespace#type syntax.

directiveContextTypes string[]
mapperTypeSuffix string

Adds a suffix to the imported names to prevent name clashes.

mappers Record<string, string>

Replaces a GraphQL type usage with a custom type, allowing you to return custom object from your resolvers. You can use both module#type and module#namespace#type syntax.

defaultMapper string

Allow you to set the default mapper when it's not being override by mappers or generics. You can specify a type name, or specify a string in module#type or module#namespace#type format. The default value of mappers is the TypeScript type generated by typescript package.

avoidOptionals AvoidOptionalsConfig_1 | boolean

This will cause the generator to avoid using optionals (?), so all field resolvers must be implemented in order to avoid compilation errors. Default value: "false"

showUnusedMappers boolean

Warns about unused mappers. Default value: "true"

enumValues object | string

A raw configuration for enumValues map - can be represented with a single string value for a file path, a map between enum name and a file path, or a map between enum name and an object with explicit enum values.

resolverTypeWrapperSignature string

Allow you to override resolverTypeWrapper definition. Default value: "Promise | T"

federation boolean

Supports Apollo Federation Default value: "false"

enumPrefix boolean

Allow you to disable prefixing for generated enums, works in combination with typesPrefix. Default value: "true"

optionalResolveType boolean

Sets the __resolveType field as optional field. Default value: "false"

immutableTypes boolean

Generates immutable types by adding readonly to properties and uses ReadonlyArray. Default value: "false"

namespacedImportName string

Prefixes all GraphQL related generated types with that value, as namespaces import. You can use this feature to allow separation of plugins to different files. Default value: "''"

resolverTypeSuffix string

Suffix we add to each generated type resolver. Default value: "Resolvers"

allResolversTypeName string

The type name to use when exporting all resolvers signature as unified type. Default value: "Resolvers"

internalResolversPrefix string

Defines the prefix value used for __resolveType and __isTypeOf resolvers. If you are using mercurius-js, please set this field to empty string for better compatibility. Default value: "'__'"

onlyResolveTypeForInterfaces boolean

Turning this flag to true will generate resolver signature that has only resolveType for interfaces, forcing developers to write inherited type resolvers in the type itself. Default value: "false"

strictScalars boolean

Makes scalars strict.

If scalars are found in the schema that are not defined in scalars an error will be thrown during codegen. Default value: "false"

defaultScalarType string

Allows you to override the type that unknown scalars will have. Default value: "any"

scalars object | string

Scalars map or a string, a map between the GraphQL scalar name and the identifier that should be used

namingConvention NamingConventionFn_2 | NamingConventionMap_2 | string
typesPrefix string

Prefixes all the generated types. Default value: ""

typesSuffix string

Suffixes all the generated types. Default value: ""

skipTypename boolean

Does not add __typename to the generated types, unless it was specified in the selection set. Default value: "false"

nonOptionalTypename boolean

Automatically adds __typename field to the generated types, even when they are not specified in the selection set, and makes it non-optional Default value: "false"

useTypeImports boolean

Will use import type {} rather than import {} when importing only types. This gives compatibility with TypeScript's "importsNotUsedAsValues": "error" option Default value: "false"

dedupeFragments boolean

Removes fragment duplicates for reducing data transfer. It is done by removing sub-fragments imports from fragment definition Instead - all of them are imported to the Operation node. Default value: "false"

inlineFragmentTypes string

Whether fragment types should be inlined into other operations. "inline" is the default behavior and will perform deep inlining fragment types within operation type definitions. "combine" is the previous behavior that uses fragment type references without inlining the types (and might cause issues with deeply nested fragment that uses list types). Default value: "inline"

emitLegacyCommonJSImports boolean

Emit legacy common js imports. Default it will be true this way it ensure that generated code works with non-compliant bundlers. Default value: "true"

flow-operations object

This plugin generates Flow types based on your GraphQLSchema and your GraphQL operations and fragments.

It generates types for your GraphQL documents: Query, Mutation, Subscription and Fragment.

This plugin requires you to use @graphql-codegen/flow as well, because it depends on its types.

37 nested properties
useFlowExactObjects boolean

Generates Flow types as Exact types. Default value: "true"

useFlowReadOnlyTypes boolean

Generates read-only Flow types Default value: "false"

flattenGeneratedTypes boolean

Flatten fragment spread and inline fragments into a simple selection set before generating. Default value: "false"

preResolveTypes boolean

Uses primitive types where possible. Set to false in order to use Pick and take use the types generated by typescript plugin. Default value: "true"

skipTypeNameForRoot boolean

Avoid adding __typename for root types. This is ignored when a selection explicitly specifies __typename. Default value: "false"

globalNamespace boolean

Puts all generated code under global namespace. Useful for Stencil integration. Default value: "false"

operationResultSuffix string

Adds a suffix to generated operation result type names Default value: ""

dedupeOperationSuffix boolean

Set this configuration to true if you wish to make sure to remove duplicate operation name suffix. Default value: "false"

omitOperationSuffix boolean

Set this configuration to true if you wish to disable auto add suffix of operation name, like Query, Mutation, Subscription, Fragment. Default value: "false"

exportFragmentSpreadSubTypes boolean

If set to true, it will export the sub-types created in order to make it easier to access fields declared under fragment spread. Default value: "false"

experimentalFragmentVariables boolean

If set to true, it will enable support for parsing variables on fragments. Default value: "false"

mergeFragmentTypes boolean

If set to true, merge equal fragment interfaces. Default value: "false"

addUnderscoreToArgsType boolean

Adds _ to generated Args types in order to avoid duplicate identifiers.

enumValues object | string

A raw configuration for enumValues map - can be represented with a single string value for a file path, a map between enum name and a file path, or a map between enum name and an object with explicit enum values.

declarationKind DeclarationKindConfig_1 | string

Overrides the default output for various GraphQL elements.

enumPrefix boolean

Allow you to disable prefixing for generated enums, works in combination with typesPrefix. Default value: "true"

fieldWrapperValue string

Allow you to add wrapper for field type, use T as the generic value. Make sure to set wrapFieldDefinitions to true in order to make this flag work. Default value: "T"

wrapFieldDefinitions boolean

Set to true in order to wrap field definitions with FieldWrapper. This is useful to allow return types such as Promises and functions. Default value: "false"

onlyEnums boolean

This will cause the generator to emit types for enums only Default value: "false"

onlyOperationTypes boolean

This will cause the generator to emit types for operations only (basically only enums and scalars) Default value: "false"

ignoreEnumValuesFromSchema boolean

This will cause the generator to ignore enum values defined in GraphQLSchema Default value: "false"

wrapEntireFieldDefinitions boolean

Set to true in order to wrap field definitions with EntireFieldWrapper. This is useful to allow return types such as Promises and functions for fields. Differs from wrapFieldDefinitions in that this wraps the entire field definition if i.e. the field is an Array, while wrapFieldDefinitions will wrap every single value inside the array. Default value: "true"

entireFieldWrapperValue string

Allow to override the type value of EntireFieldWrapper. This wrapper applies outside of Array and Maybe unlike fieldWrapperValue, that will wrap the inner type. Default value: "T | Promise | (() => T | Promise)"

directiveArgumentAndInputFieldMappings __type_17
directiveArgumentAndInputFieldMappingTypeSuffix string

Adds a suffix to the imported names to prevent name clashes.

strictScalars boolean

Makes scalars strict.

If scalars are found in the schema that are not defined in scalars an error will be thrown during codegen. Default value: "false"

defaultScalarType string

Allows you to override the type that unknown scalars will have. Default value: "any"

scalars object | string

Scalars map or a string, a map between the GraphQL scalar name and the identifier that should be used

namingConvention NamingConventionFn_2 | NamingConventionMap_2 | string
typesPrefix string

Prefixes all the generated types. Default value: ""

typesSuffix string

Suffixes all the generated types. Default value: ""

skipTypename boolean

Does not add __typename to the generated types, unless it was specified in the selection set. Default value: "false"

nonOptionalTypename boolean

Automatically adds __typename field to the generated types, even when they are not specified in the selection set, and makes it non-optional Default value: "false"

useTypeImports boolean

Will use import type {} rather than import {} when importing only types. This gives compatibility with TypeScript's "importsNotUsedAsValues": "error" option Default value: "false"

dedupeFragments boolean

Removes fragment duplicates for reducing data transfer. It is done by removing sub-fragments imports from fragment definition Instead - all of them are imported to the Operation node. Default value: "false"

inlineFragmentTypes string

Whether fragment types should be inlined into other operations. "inline" is the default behavior and will perform deep inlining fragment types within operation type definitions. "combine" is the previous behavior that uses fragment type references without inlining the types (and might cause issues with deeply nested fragment that uses list types). Default value: "inline"

emitLegacyCommonJSImports boolean

Emit legacy common js imports. Default it will be true this way it ensure that generated code works with non-compliant bundlers. Default value: "true"

introspection object

This plugin generates a GraphQL introspection file based on your GraphQL schema.

6 nested properties
minify boolean

Set to true in order to minify the JSON output. Default value: "false"

descriptions boolean

Whether to include descriptions in the introspection result. Default value: "true"

specifiedByUrl boolean

Whether to include specifiedByUrl in the introspection result. Default value: "false"

directiveIsRepeatable boolean

Whether to include isRepeatable flag on directives. Default value: "true"

schemaDescription boolean

Whether to include description field on schema. Default value: "false"

federation boolean
fragment-matcher object

This plugin generates an introspection file but only with Interfaces and Unions, based on your GraphQLSchema.

If you are using apollo-client and your schema contains interface or union declaration, it's recommended to use Apollo's Fragment Matcher and the result generated by the plugin.

You can read more about it in apollo-client documentation.

Fragment Matcher plugin accepts a TypeScript / JavaScript or a JSON file as an output (.ts, .tsx, .js, .jsx, .json).

Both in TypeScript and JavaScript a default export is being used.

The output is based on the output you choose for the output file name.

5 nested properties
module string

Compatible only with JSON extension, allow you to choose the export type, either module.exports or export default. Allowed values are: commonjs, es2015. Default value: "es2015"

Values: "commonjs" "es2015"
apolloClientVersion number

Compatible only with TS/TSX/JS/JSX extensions, allow you to generate output based on your Apollo Client version. Note: 3 also works for version 4. Default value: "3"

Values: 2 3
useExplicitTyping boolean

Create an explicit type based on your schema. This can help IDEs autofill your fragment matcher. This is mostly useful if you do more with your fragment matcher than just pass it to an Apollo-Client. Default value: "false"

federation boolean
deterministic boolean

When enabled sorts the fragment types lexicographically. This is useful for deterministic output. Default value: "false"

urql-introspection object

This plugin generates an introspection file for Schema Awareness feature of Urql Cache Exchange

You can read more about it in urql documentation: https://formidable.com/open-source/urql/docs/graphcache/schema-awareness.

Urql Introspection plugin accepts a TypeScript / JavaScript or a JSON file as an output (.ts, .tsx, .js, .jsx, .json).

Both in TypeScript and JavaScript a default export is being used.

The output is based on the output you choose for the output file name.

6 nested properties
module string

Compatible only with JSON extension, allow you to choose the export type, either module.exports or export default. Allowed values are: commonjs, es2015. Default value: "es2015"

Values: "commonjs" "es2015"
useTypeImports boolean

Will use import type {} rather than import {} when importing only types. This gives compatibility with TypeScript's "importsNotUsedAsValues": "error" option Default value: "false"

includeScalars boolean

Includes scalar names (instead of an Any replacement) in the output when enabled. Default value: "false"

includeEnums boolean

Includes enums (instead of an Any replacement) in the output when enabled. Default value: "false"

includeInputs boolean

Includes all input objects (instead of an Any replacement) in the output when enabled. Default value: "false"

includeDirectives boolean

Includes all directives in the output when enabled. Default value: "false"

hasura-allow-list object
4 nested properties
collectionName string

Choose the collection name to be generated. Defaults to allowed-queries Default value: "allowed-queries"

configVersion number

Target metadata config version. Supported versions are 2 and 3. This is mostly for future proofing, currently has no impact as both versions use the same format. The default value will change in the future if/when newer config versions are released. Default value: "3"

Values: 2 3
globalFragments boolean

Whether to source fragments per-document, or globally. If set, will enforce fragment name uniqueness Default value: "false"

fragmentsOrder string

Whether to order fragments by global definition order, or by definition order in the document Default value: "definition"

Values: "document" "global"
T object
Types.ConfiguredOutput object

List of plugins to apply to this current output file.

You can either specify plugins from the community using the NPM package name (after you installed it in your project), or you can use a path to a local file for custom plugins.

You can find a list of available plugins here: https://the-guild.dev/graphql/codegen/docs/plugins/index Need a custom plugin? read this: https://the-guild.dev/graphql/codegen/docs/custom-codegen/index

preset Types.OutputPreset | string

If your setup uses Preset to have a more dynamic setup and output, set the name of your preset here.

Presets are a way to have more than one file output, for example: https://the-guild.dev/graphql/codegen/docs/presets/near-operation-file

You can either specify a preset from the community using the NPM package name (after you installed it in your project), or you can use a path to a local file for a custom preset.

List of available presets: https://graphql-code-generator.com/docs/presets/presets-index

presetConfig Record<string, any>

If your setup uses Preset to have a more dynamic setup and output, set the configuration object of your preset here.

List of available presets: https://graphql-code-generator.com/docs/presets/presets-index

overwrite boolean

A flag to overwrite files if they already exist when generating code (true by default).

For more details: https://graphql-code-generator.com/docs/config-reference/codegen-config

config
hooks __type_4

DocumentTransform changes documents before executing plugins.

watchPattern string[] | string

: Additional file pattern to watch when using watch mode

__type_2 object
buildGeneratesSection object
prepareDocuments object
Types.OutputPreset object
buildGeneratesSection object
prepareDocuments object
__type_3 Record<string, object>
Types.PluginConfig Record<string, object>
__type_4 object
afterStart Types.HookFunction | Types.HookFunction | string[] | string
beforeDone Types.HookFunction | Types.HookFunction | string[] | string
onWatchTriggered Types.HookFunction | Types.HookFunction | string[] | string
onError Types.HookFunction | Types.HookFunction | string[] | string
afterOneFileWrite Types.HookFunction | Types.HookFunction | string[] | string
afterAllFileWrite Types.HookFunction | Types.HookFunction | string[] | string
beforeOneFileWrite Types.HookFunction | Types.HookAlterFunction | Types.HookFunction | Types.HookAlterFunction | string[] | string
beforeAllFileWrite Types.HookFunction | Types.HookFunction | string[] | string
Types.LifeCycleHookValue Types.HookFunction | Types.HookFunction | string[] | string
__type_5 object
Types.HookFunction object
Types.LifeCycleAlterHookValue Types.HookFunction | Types.HookAlterFunction | Types.HookFunction | Types.HookAlterFunction | string[] | string
__type_6 object
Types.HookAlterFunction object
Partial object
afterStart Types.HookFunction | Types.HookFunction | string[] | string
beforeDone Types.HookFunction | Types.HookFunction | string[] | string
onWatchTriggered Types.HookFunction | Types.HookFunction | string[] | string
onError Types.HookFunction | Types.HookFunction | string[] | string
afterOneFileWrite Types.HookFunction | Types.HookFunction | string[] | string
afterAllFileWrite Types.HookFunction | Types.HookFunction | string[] | string
beforeOneFileWrite Types.HookFunction | Types.HookAlterFunction | Types.HookFunction | Types.HookAlterFunction | string[] | string
beforeAllFileWrite Types.HookFunction | Types.HookFunction | string[] | string
Types.OutputDocumentTransform<object> Types.DocumentTransformObject | Types.DocumentTransformFileConfig | string
__type_7 object
transform __type_8
__type_8 object
Types.DocumentTransformFunction object
Types.DocumentTransformObject object
transform __type_8
__type_9 Record<string, object>
T_1 object
Types.DocumentTransformFileConfig Record<string, object>
__type_10 object
Types.PackageLoaderFn object
Array object[]
TypeNamePattern object

A compact string of patterns used in the config for granular configuration of Graphql Types.

The string can contain one or more patterns, each pattern ends with a semi-colon (;).

To apply an option to all Graphql Types or all fields, use the allTypeNames (@*TypeNames) tokens.

Wherever you use the allTypeNames token, know very well that you can make some exceptions. After all, to every rule, there is an exception.

A square bracket ([]) is used to specify what should be included and a negated square bracket (-[]) is used to specify what should be excluded.

Manually typing out a pattern may be prone to typos resulting in invalid patterns therefore the TypeNamePattern class exposes some builder methods to be used in the plugin config file.

Available Builder Methods and the patterns they make

const Droid = TypeName.fromString('Droid');
const Starship = TypeName.fromString('Starship');
const Human = TypeName.fromString('Human');
const Movie = TypeName.fromString('Movie');


// Configuring specific Graphql Types
const pattern = TypeNamePattern.forTypeNames([Droid, Starship]);
console.log(pattern); // "Droid;Starship;"

// Configuring all Graphql Types
const pattern = TypeNamePattern.forAllTypeNames();
console.log(pattern); // "@*TypeNames;"

// Configuring all Graphql Types except those specified in the exclusion list of TypeNames
const pattern = TypeNamePattern.forAllTypeNamesExcludeTypeNames([Droid, Starship]);
console.log(pattern); // "@*TypeNames-[Droid,Starship];"
_value
value string
UnionValueCase string
TypeName object

represents a single valid GraphQL Type Name used in the GraphQL Schema provided

_value
value string
__type_11 object
endpoint string
fetchParams Record_1 | string
__type_12 object
Record_1 object
HardcodedFetch object
endpoint string
fetchParams Record_1 | string
NamingConvention NamingConventionFn | NamingConventionMap | string
__type_13 object
NamingConventionFn object
NamingConventionMap object
enumValues NamingConventionFn | string
typeNames NamingConventionFn | string
transformUnderscore boolean
ScalarsMap object | string

Scalars map or a string, a map between the GraphQL scalar name and the identifier that should be used

DocumentMode string
ScalarsMap_1 object | string

Scalars map or a string, a map between the GraphQL scalar name and the identifier that should be used

NamingConvention_1 NamingConventionFn_1 | NamingConventionMap_1 | string
__type_14 object
NamingConventionFn_1 object
NamingConventionMap_1 object
enumValues NamingConventionFn_1 | string
typeNames NamingConventionFn_1 | string
transformUnderscore boolean
AvoidOptionalsConfig object
field boolean
object boolean
inputValue boolean
defaultValue boolean
resolvers boolean
query boolean
mutation boolean
subscription boolean
EnumValuesMap object | string

A raw configuration for enumValues map - can be represented with a single string value for a file path, a map between enum name and a file path, or a map between enum name and an object with explicit enum values.

AdditionalProps object
DeclarationKindConfig object
directive string
Values: "abstract class" "class" "interface" "type"
scalar string
Values: "abstract class" "class" "interface" "type"
input string
Values: "abstract class" "class" "interface" "type"
type string
Values: "abstract class" "class" "interface" "type"
interface string
Values: "abstract class" "class" "interface" "type"
arguments string
Values: "abstract class" "class" "interface" "type"
DeclarationKind string
__type_15 Record<string, string>

A map between the GraphQL directive name and the identifier that should be used

DirectiveArgumentAndInputFieldMappings Record<string, string>

A map between the GraphQL directive name and the identifier that should be used

CustomDirectivesConfig object
apolloUnmask boolean

Adds integration with Apollo Client's @unmask directive when using Apollo Client's data masking feature. @unmask ensures fields marked by @unmask are available in the type definition. Default value: "false"

JsonAttributesSource string
__type_16 object
type string
interface string
field string
input string
arguments string
Partial_1 object
type string
interface string
field string
input string
arguments string
AvoidOptionalsConfig_1 object
field boolean
object boolean
inputValue boolean
defaultValue boolean
resolvers boolean
EnumValuesMap_1 object | string

A raw configuration for enumValues map - can be represented with a single string value for a file path, a map between enum name and a file path, or a map between enum name and an object with explicit enum values.

AdditionalProps_1 object
DeclarationKindConfig_1 object
directive string
Values: "abstract class" "class" "interface" "type"
scalar string
Values: "abstract class" "class" "interface" "type"
input string
Values: "abstract class" "class" "interface" "type"
type string
Values: "abstract class" "class" "interface" "type"
interface string
Values: "abstract class" "class" "interface" "type"
arguments string
Values: "abstract class" "class" "interface" "type"
DeclarationKind_1 string
__type_17 Record<string, string>

A map between the GraphQL directive name and the identifier that should be used

DirectiveArgumentAndInputFieldMappings_1 Record<string, string>

A map between the GraphQL directive name and the identifier that should be used

ScalarsMap_2 object | string

Scalars map or a string, a map between the GraphQL scalar name and the identifier that should be used

NamingConvention_2 NamingConventionFn_2 | NamingConventionMap_2 | string
__type_18 object
NamingConventionFn_2 object
NamingConventionMap_2 object
enumValues NamingConventionFn_2 | string
typeNames NamingConventionFn_2 | string
transformUnderscore boolean
Array_1 string[]
ResolversNonOptionalTypenameConfig object
unionMember boolean
interfaceImplementingType boolean
excludeTypes string[]
ReactApolloPluginConfigDefaultBaseOptions Record<string, any>
awaitRefetchQueries boolean
errorPolicy string
fetchPolicy string
ignoreResults boolean
notifyOnNetworkStatusChange boolean
returnPartialData boolean
ssr boolean
StencilComponentType string
FileType number
__type_19 object
FragmentImportFromFn object
GeneratedPluginsMap object | string | string | string