Skip to content

Commit ed71811

Browse files
authored
Passthrough client-preset config values for output (#10155)
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.
1 parent 5724234 commit ed71811

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

.changeset/swift-wasps-beam.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@graphql-codegen/client-preset': minor
3+
---
4+
5+
client-preset generated output is configurable with onlyOperationTypes and onlyEnumTypes

packages/presets/client/src/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,8 @@ export const preset: Types.OutputPreset<ClientPresetConfig> = {
134134
avoidOptionals: options.config.avoidOptionals,
135135
documentMode: options.config.documentMode,
136136
skipTypeNameForRoot: options.config.skipTypeNameForRoot,
137+
onlyOperationTypes: options.config.onlyOperationTypes,
138+
onlyEnumTypes: options.config.onlyEnumTypes,
137139
};
138140

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

0 commit comments

Comments
 (0)