graphql-code-generator
graphql-code-generator copied to clipboard
Support adding file contents via 'add' plugin
Is your feature request related to a problem? Please describe.
I use graphql-codegen to write the same type definitions for my db types into a few different dockerized services. Some of these types are user-defined, which i currently specify with the 'add' plugin. However I have to duplicate these definitions for each output file, which is getting to be a little bit annoying to maintain. Plus I don't get syntax highlighting since this "code" is technically a string literal in my config file.
Describe the solution you'd like
A way to specify a file path in the 'add' plugin and have the plugin copy file contents
Describe alternatives you've considered
I tried putting "import * as X from './types'" but I had trouble getting this to work with my docker setup because I need to make the ./types file available to each container.
Currently I duplicate the types that I want to add for each output file