dotansimha / dotansimha/graphql-code-generator-community
Add persistedDocuments support for other presets or add it to a plugin.
- Dominant language
- TypeScript
- Stars
- 137
- Forks
- 195
- Avg merge
- 6h 20m
- Merged PRs (30d)
- 16
Description
**Is your feature request related to a problem? Please describe.**
We have `@graphql-codegen/client-preset` which has a [persistedDocuments](https://the-guild.dev/graphql/codegen/plugins/presets/preset-client#enable-persisted-documents) 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](https://github.com/valu-digital/graphql-codegen-persisted-query-ids), but it doesn't calculate the hash correctly.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by comparing the persistedDocuments behavior documented for @graphql-codegen/client-preset with the implementation and configuration flow of @graphql-codegen/near-operation-file-preset. Review the linked persisted-query-ids plugin as an alternative design, then define how hashes should be calculated and verify that persistedDocuments works for the near-operation-file preset without changing the client-preset behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- graphql, typescript
- Domain
- api, tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 32/100