Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions docs/content/1.getting-started/4.configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ export default defineNuxtConfig({
avoidOptionals: false,
disableOnBuild: false,
maybeValue: 'T | null',
inputMaybeValue: 'Maybe<T>',
scalars: {}
}
}
Expand Down Expand Up @@ -129,6 +130,12 @@ Disable Code Generation for production builds.

Allow to override the type value of `Maybe`. See [GraphQL Code Generator documentation](https://the-guild.dev/graphql/codegen/plugins/typescript/typescript-operations#maybevalue) for more options

### `inputMaybeValue`

- default: `"Maybe<T>"`

Allow to override the type value of `InputMaybe`. See [GraphQL Code Generator documentation](https://the-guild.dev/graphql/codegen/plugins/typescript/typescript#inputMaybeValue) for more options

### `scalars`

- default: `{}`
Expand Down
1 change: 1 addition & 0 deletions src/generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ function prepareConfig(options: GenerateOptions & GqlCodegen): CodegenConfig {
},
avoidOptionals: options?.avoidOptionals,
maybeValue: options?.maybeValue,
inputMaybeValue: options?.inputMaybeValue,
scalars: options?.scalars
}

Expand Down
1 change: 1 addition & 0 deletions src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ export default defineNuxtModule<GqlConfig>({
onlyOperationTypes: true,
avoidOptionals: false,
maybeValue: 'T | null',
inputMaybeValue: 'Maybe<T>',
scalars: {}
}

Expand Down
6 changes: 6 additions & 0 deletions src/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,12 @@ export interface GqlCodegen {
*/
maybeValue?: string

/**
* Allow to override the type value of InputMaybe.
(https://the-guild.dev/graphql/codegen/plugins/typescript/typescript#inputMaybeValue)
*/
inputMaybeValue?: string

/**
* Extends or overrides the built-in scalars and custom GraphQL scalars to a custom type.
(https://the-guild.dev/graphql/codegen/plugins/typescript/typescript#scalars
Expand Down
Loading