-
Notifications
You must be signed in to change notification settings - Fork 2
feat: graphql-codegen plugin #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
7657d57
to
e382df3
Compare
e382df3
to
e88bf85
Compare
"peerDependencies": { | ||
"@graphql-codegen/plugin-helpers": "^5.0.0", | ||
"graphql": "^16.0.0" | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Peer deps because it's a graphql-codegen plugin, expectation is that these packages are already installed
Claude did a very good job adding docstrings 💅🏻 |
/** | ||
* Output format - 'server' generates hash->operation mapping, | ||
* 'client' generates operation->hash mapping | ||
*/ | ||
output: 'server' | 'client'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I hate that we have to run the plugin twice because of how codegen works lol
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nothing major
Part of a stack of PRs
Allows us to do this now:

Main Changes in this PR:
Ports our existing plugin while cleaning it up and making it more structured
also adding support for
includeAlgorithmPrefix
to help match the graphql-over-http spec this is still not implemented completely in the apollo graphql client so keeping it defaulted to false for now - eg. relay decided to use md5 hashescore logic remains the same, doing cosmetic changes to make the package more maintainable
Test coverage in stacked PR: feat: tests #3
Did a quick sanity check by enabling the
includeAlgorithmPrefix
option and then turning it off, matches the existing generated manifest ( Note: I plan to use it without the algorithm prefix. )