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
5 changes: 5 additions & 0 deletions .changeset/fruity-comics-argue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@graphql-codegen/client-preset': minor
---

The client preset now allows the use of the `futureProofUnions` config option
1 change: 1 addition & 0 deletions packages/presets/client/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ export const preset: Types.OutputPreset<ClientPresetConfig> = {
enumsAsConst: options.config.enumsAsConst,
enumValues: options.config.enumValues,
futureProofEnums: options.config.futureProofEnums,
futureProofUnions: options.config.futureProofUnions,
nonOptionalTypename: options.config.nonOptionalTypename,
avoidOptionals: options.config.avoidOptionals,
documentMode: options.config.documentMode,
Expand Down
1 change: 1 addition & 0 deletions website/src/pages/plugins/presets/preset-client.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ The `client` preset allows the following `config` options:
- [`enumsAsConst`](/plugins/typescript/typescript#enumsasconst): 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.
- [`enumValues`](/plugins/typescript/typescript#enumvalues): Overrides the default value of enum values declared in your GraphQL schema. You can also map the entire enum to an external type by providing a string that of module#type.
- [`futureProofEnums`](/plugins/typescript/typescript#futureproofenums): Adds a catch-all entry to enum type definitions for values that may be added in the future.
- [`futureProofUnions`](/plugins/typescript/typescript#futureproofunions): Adds a catch-all entry to union type definitions for values that may be added in the future.
- [`nonOptionalTypename`](/plugins/typescript/typescript#nonoptionaltypename): Automatically adds `__typename` field to the generated types, even when they are not specified in the selection set, and makes it non-optional.
- [`avoidOptionals`](/plugins/typescript/typescript#avoidoptionals): This will cause the generator to avoid using TypeScript optionals (`?`) on types.
- [`documentMode`](#documentmode): Allows you to control how the documents are generated.
Expand Down