Closed kdawgwilk closed 4 months ago
I was able to find the right hooks and add this in
config: CodegenConfig = {
schema: 'api/**/schema.graphql',
ignoreNoDocuments: true, // for better experience with the watcher
generates: {
'api/src/schema': {
...defineConfig({
typesPluginsConfig: {
contextType: './context.js#Context',
},
emitLegacyCommonJSImports: false,
}),
hooks: {
afterOneFileWrite: ['prettier --write'],
},
},
'web/src/lib/gql/': {
preset: 'client',
documents: 'web/src/**/*.tsx',
},
},
};
Is your feature request related to a problem? Please describe. The code generated does not line up with my formatting settings and so every time I go to commit I have to run the formatter for all code generated
Describe the solution you'd like It would be great if the generated code was formatted to match my projects settings automatically during generation
Describe alternatives you've considered Hook into the code gen process and run the formatted myself as a post generation step, not sure if the right hooks are available for this