Skip to content

Conversation

darshkpatel
Copy link
Collaborator

@darshkpatel darshkpatel commented Mar 18, 2025

Part of a stack of PRs

Allows us to do this now:
Screenshot 2025-03-18 at 10 15 31 AM

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 hashes

  • core 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. )

Screenshot 2025-03-17 at 5 00 07 PM

Copy link
Collaborator Author

darshkpatel commented Mar 18, 2025

This stack of pull requests is managed by Graphite. Learn more about stacking.

@darshkpatel darshkpatel force-pushed the 03-17-feat_implement_plugin branch from 7657d57 to e382df3 Compare March 18, 2025 01:37
@darshkpatel darshkpatel force-pushed the 03-17-feat_implement_plugin branch from e382df3 to e88bf85 Compare March 18, 2025 01:51
This was referenced Mar 18, 2025
Comment on lines +38 to +41
"peerDependencies": {
"@graphql-codegen/plugin-helpers": "^5.0.0",
"graphql": "^16.0.0"
},
Copy link
Collaborator Author

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

@darshkpatel darshkpatel requested a review from masad-frost March 18, 2025 04:09
@darshkpatel darshkpatel marked this pull request as ready for review March 18, 2025 04:09
@darshkpatel
Copy link
Collaborator Author

darshkpatel commented Mar 18, 2025

Claude did a very good job adding docstrings 💅🏻

Comment on lines +8 to +12
/**
* Output format - 'server' generates hash->operation mapping,
* 'client' generates operation->hash mapping
*/
output: 'server' | 'client';
Copy link
Member

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

Copy link
Member

@masad-frost masad-frost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nothing major

@darshkpatel darshkpatel merged commit 8e06c51 into main Mar 18, 2025
@darshkpatel darshkpatel deleted the 03-17-feat_implement_plugin branch March 19, 2025 01:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants