Skip to content

Commit e63f839

Browse files
authored
fix: react query mode output should be default for generate (#593)
1 parent c170806 commit e63f839

3 files changed

Lines changed: 3 additions & 1 deletion

File tree

graphql/codegen/src/cli/commands/generate.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@ async function loadConfig(options: GenerateOptions): Promise<LoadConfigResult> {
219219
hooks: baseConfig.hooks,
220220
postgraphile: baseConfig.postgraphile,
221221
codegen: baseConfig.codegen,
222+
reactQuery: baseConfig.reactQuery,
222223
};
223224

224225
// Validate at least one source is provided

graphql/codegen/src/cli/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ async function loadWatchConfig(options: {
5757
postgraphile: baseConfig.postgraphile,
5858
codegen: baseConfig.codegen,
5959
orm: baseConfig.orm,
60+
reactQuery: baseConfig.reactQuery,
6061
watch: {
6162
...baseConfig.watch,
6263
// CLI options override config

graphql/codegen/src/types/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ export const DEFAULT_CONFIG: Omit<ResolvedConfig, 'endpoint' | 'schema'> = {
269269
},
270270
orm: null, // ORM generation disabled by default
271271
reactQuery: {
272-
enabled: false, // React Query hooks disabled by default
272+
enabled: true, // React Query hooks enabled by default for generate command
273273
},
274274
watch: DEFAULT_WATCH_CONFIG,
275275
};

0 commit comments

Comments
 (0)