Skip to content

Commit

Permalink
Passthrough client-preset config values for output (#10155)
Browse files Browse the repository at this point in the history
Passthrough the `onlyOperationTypes` and `onlyEnumTypes` configuration
options which enables consumers to opt into avoiding generating
redundant types from the schema that they haven't requested in
documents.
  • Loading branch information
nebbles authored Dec 23, 2024
1 parent 5724234 commit ed71811
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/swift-wasps-beam.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@graphql-codegen/client-preset': minor
---

client-preset generated output is configurable with onlyOperationTypes and onlyEnumTypes
2 changes: 2 additions & 0 deletions packages/presets/client/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@ export const preset: Types.OutputPreset<ClientPresetConfig> = {
avoidOptionals: options.config.avoidOptionals,
documentMode: options.config.documentMode,
skipTypeNameForRoot: options.config.skipTypeNameForRoot,
onlyOperationTypes: options.config.onlyOperationTypes,
onlyEnumTypes: options.config.onlyEnumTypes,
};

const visitor = new ClientSideBaseVisitor(options.schemaAst!, [], options.config, options.config);
Expand Down

0 comments on commit ed71811

Please sign in to comment.