graphqlgen
graphqlgen copied to clipboard
specifying the output directory for generated type files
With the splitting of graphqlgen.ts
into several files (as per https://github.com/prisma/graphqlgen/issues/115) the function of the output
setting in graphqlgen.yml
needs to be updated.
Currently, it's used to specify a single output file which all types will be placed into:
output: ./src/generated/graphqlgen.ts # all types go here
resolver-scaffolding:
output: ./src/generated/tmp-resolvers/ # scaffolded resolvers go in this directory
Minimally, we could update this to specify a directory which the type files will be placed into:
output: ./src/generated/types
resolver-scaffolding:
output: ./src/generated/tmp-resolvers/
On the other hand, this may also be a good opportunity to set up some reasonable defaults and behavior for output path configuration. For example, often times it's probably enough to only specify a "namespace" for the output (e.g. ./src/generated/graphqlgen/
) and implicitly write type files and resolver scaffolds to subfolders therein.
I'd suggest the following minimal change output: ./src/generated/graphqlgen.ts
to output: ./src/generated/graphqlgen/
. For now, I suggest putting all the files in one folder (maybe an additional index.ts
file?).