Add persistedDocuments support for other presets or add it to a plugin.
Is your feature request related to a problem? Please describe.
We have @graphql-codegen/client-preset which has a persistedDocuments config, however I am using @graphql-codegen/near-operation-file-preset and there is no way to calculate the hash here.
Describe the solution you'd like
Implement persistedDocuments for @graphql-codegen/near-operation-file-preset
Describe alternatives you've considered
Implement this as a plugin and use it for all presets at once.
Additional context
I am currently using urql with automatic hash calculation. I found the following plugin graphql-codegen-persisted-query-ids, but it doesn't calculate the hash correctly.
@saihaj gentle ping. Is there any chance that this will appear in the near-operation-file-preset? This is the second most popular preset after @graphql-codegen/client-preset which comes by default.
I'm very interested in this functionality as well. I've added a PR as a starting point, having Cline / Anthropic AI see if it could figure out how client-preset worked and port the functionality. Hoping someone else knows how to properly test and finish the PR.
I wrote a working plugin for client-preset to replace the functionality in near-operation-file-preset. As a plugin, it supports all options that client-preset does, including persisted document support. Does anyone want to volunteer to make it into a PR for this repo? Source code at https://github.com/Shane32/graphql-codegen-near-operation-file-plugin