Skip to content

Commit

Permalink
temp disable hot schema reload (#1349)
Browse files Browse the repository at this point in the history
* temp disable hot schema reload

* add CLI flag for hotschema reload

* fix
  • Loading branch information
bz888 authored Oct 17, 2022
1 parent d151a33 commit 20e8291
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/query/src/graphql/graphql.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,10 @@ export class GraphqlModule implements OnModuleInit, OnModuleDestroy {
if (retries > 0) {
try {
const builder = await getPostGraphileBuilder(this.pgPool, [dbSchema], options);
await builder.watchSchema(this.schemaListener.bind(this));
if (!argv['disable-hot-schema']) {
await builder.watchSchema(this.schemaListener.bind(this));
}
logger.info('Hot schema reload disabled');

const graphqlSchema = builder.buildSchema();
return graphqlSchema;
Expand Down
6 changes: 6 additions & 0 deletions packages/query/src/yargs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,12 @@ export function getYargsOption() {
describe: 'Enable aggregate feature',
type: 'boolean',
},
'disable-hot-schema': {
demandOption: false,
describe: 'Hot reload schema on schema-changes',
type: 'boolean',
default: true,
},
});
}

Expand Down

0 comments on commit 20e8291

Please sign in to comment.