Generating resolver types for multiple resolver files #8146
-
Let's say I have a project with the following structure:
I would like to generate resolver types for both
and would prefer a solution that let's me just generate types without migrating everything to use the graphql-modules framework. This is my codegen.yml: overwrite: true
schema: 'src/**/*.graphql'
documents: null
generates:
src/generated/:
preset: graphql-modules
presetConfig:
baseTypesPath: ../__generated__/graphql.ts
filename: __generated__/module-types.ts
useGraphQLModules: false
plugins:
- 'typescript'
- 'typescript-resolvers' After running this it only creates the base types in I created this repl.it that reproduces the scenario described. Can be helpful for those that want to fork and play around: https://replit.com/@seanlenny/graphql-codegen-with-multiple-resolver-files |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Had a mistake in the codegen.yml: ...
generates:
src/: # should be src/
preset: graphql-modules
presetConfig:
baseTypesPath: ./__generated__/graphql.ts # adjust relative path |
Beta Was this translation helpful? Give feedback.
Had a mistake in the codegen.yml: