Appearance
Module Options
autoImportPatterns?
optionalautoImportPatterns:string[]
Defined in: options.ts:25
File glob patterns for the auto import feature.
If left empty, no documents are auto imported.
Default
json
["**/.{gql,graphql}", "!node_modules"]Example
ts
// Load .graphql files from pages folder and from a node_modules dependency.
const autoImportPatterns = [
'./pages/**/*.graphql',
'node_modules/my_library/dist/**/*.graphql',
]clientCache?
optionalclientCache:object
Defined in: options.ts:180
Client caching configuration.
enabled?
optionalenabled:boolean
maxSize?
optionalmaxSize:number
codegenConfig?
optionalcodegenConfig:GeneratorOptions
Defined in: options.ts:139
Options for graphql-typescript-deluxe code generator.
See
codegenSchemaConfig?
optionalcodegenSchemaConfig:object
Defined in: options.ts:144
Configuration for graphql-codegen when downloading the schema.
schemaAstConfig?
optionalschemaAstConfig:SchemaASTConfig
Configure how the schema.graphql file should be generated.
See
urlSchemaOptions?
optionalurlSchemaOptions:UrlSchemaOptions
Configure how the schema-ast introspection request should be made.
Usually this is where you can provide a custom authentication header:
typescript
const codegenSchemaConfig = {
urlSchemaOptions: {
headers: {
authentication: 'foobar',
},
},
}See
debug?
optionaldebug:boolean
Defined in: options.ts:82
Enable detailled debugging messages.
Default
ts
falsedevtools?
optionaldevtools:boolean
Defined in: options.ts:175
Enable Nuxt DevTools integration.
documents?
optionaldocuments:string[]
Defined in: options.ts:56
Additional raw documents to include.
Useful if for example you need to generate queries during build time.
Default
ts
;[]Example
ts
const documents = [
`
query myQuery {
articles {
title
id
}
}`,
...getGeneratedDocuments(),
]downloadSchema?
optionaldownloadSchema:boolean
Defined in: options.ts:105
Download the GraphQL schema and store it on disk.
Usually you'll want to only enable this during dev mode.
Default
ts
trueenableFileUploads?
optionalenableFileUploads:boolean
Defined in: options.ts:75
Enable support for uploading files via GraphQL.
When enabled, an additional useGraphqlUploadMutation composable is included, in addition to a new server endpoint that handles multi part file uploads for GraphQL mutations.
errorOverlay?
optionalerrorOverlay:boolean
Defined in: options.ts:87
Displays GraphQL response errors in an overlay in dev mode.
graphqlConfigFilePath?
optionalgraphqlConfigFilePath:string
Defined in: options.ts:34
The path where your graphql.config.ts is, relative to the location of nuxt.config.ts.
Used to generate the correct paths in the graphql.config.ts file generated by the module.
Default
ts
'./graphql.config.ts'graphqlEndpoint
graphqlEndpoint:
string
Defined in: options.ts:96
The URL of the GraphQL server.
For the runtime execution you can provide a method that determines the endpoint during runtime. See the server/graphqlMiddleware.serverOptions.ts documentation for more information.
includeComposables?
optionalincludeComposables:boolean
Defined in: options.ts:66
Wether the useGraphqlQuery, useGraphqlMutation and useGraphqlState composables should be included.
Default
ts
truelogOnlyErrors?
optionallogOnlyErrors:boolean
Defined in: options.ts:132
Logs only errors.
When enabled only errors are logged to the console when generating the GraphQL operations. If false, all operations are logged, including valid ones.
schemaPath?
optionalschemaPath:string
Defined in: options.ts:115
Path to the GraphQL schema file.
If downloadSchema is true, the downloaded schema is written to this specified path. If downloadSchema is false, this file must be present in order to generate types.
Default
ts
'./schema.graphql'serverApiPrefix?
optionalserverApiPrefix:string
Defined in: options.ts:124
The prefix for the server route.
Default
ts
'/api/graphql_middleware'