dotansimha / dotansimha/graphql-code-generator
Support adding file contents via 'add' plugin
- Dominant language
- TypeScript
- Stars
- 11.3k
- Forks
- 1.4k
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 23
Description
### 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
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.