Custom plugin extending react-apollo #4229
-
Hi, I pushed some sample code based on the react-apollo plugin here: https://github.com/correttojs/graphql-codegen-apollo-cache Once I tested the plugin together with the react-apollo plugin, all the query documents were duplicated. and I removed the Operations import: I also wanted to generate my new plugin into a different file (in order to avoid some circular dependencies eslint warnings). So I created a second output definition within the codegen.yml configuration and included all the imports to the required query documents and types. My question is: is there a better way to achieve the same result? Would you be interested in this plugin? I could complete it following your suggestions |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @correttojs You plugin extends PRs are welcome ;) |
Beta Was this translation helpful? Give feedback.
Hi @correttojs
You plugin extends
ClientSideBaseVisitor
which already generates documents for you. I think maybe we need to break it down to small pieces (thebuildOperation
) method, and allow you to skip generating documents again.PRs are welcome ;)