[client-preset] Make persisted docs default hashing algorithm sha256, and follow recommended format#10652
Conversation
🦋 Changeset detectedLatest commit: 16da7db The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
🚀 Snapshot Release (
|
| Package | Version | Info |
|---|---|---|
@graphql-codegen/cli |
7.0.0-alpha-20260323113908-33f45bf480eca7cc9aef160da1e6e7c91c33a326 |
npm ↗︎ unpkg ↗︎ |
@graphql-codegen/core |
6.0.0-alpha-20260323113908-33f45bf480eca7cc9aef160da1e6e7c91c33a326 |
npm ↗︎ unpkg ↗︎ |
@graphql-codegen/add |
7.0.0-alpha-20260323113908-33f45bf480eca7cc9aef160da1e6e7c91c33a326 |
npm ↗︎ unpkg ↗︎ |
@graphql-codegen/fragment-matcher |
7.0.0-alpha-20260323113908-33f45bf480eca7cc9aef160da1e6e7c91c33a326 |
npm ↗︎ unpkg ↗︎ |
@graphql-codegen/introspection |
6.0.0-alpha-20260323113908-33f45bf480eca7cc9aef160da1e6e7c91c33a326 |
npm ↗︎ unpkg ↗︎ |
@graphql-codegen/schema-ast |
6.0.0-alpha-20260323113908-33f45bf480eca7cc9aef160da1e6e7c91c33a326 |
npm ↗︎ unpkg ↗︎ |
@graphql-codegen/time |
7.0.0-alpha-20260323113908-33f45bf480eca7cc9aef160da1e6e7c91c33a326 |
npm ↗︎ unpkg ↗︎ |
@graphql-codegen/visitor-plugin-common |
7.0.0-alpha-20260323113908-33f45bf480eca7cc9aef160da1e6e7c91c33a326 |
npm ↗︎ unpkg ↗︎ |
@graphql-codegen/typescript-document-nodes |
6.0.0-alpha-20260323113908-33f45bf480eca7cc9aef160da1e6e7c91c33a326 |
npm ↗︎ unpkg ↗︎ |
@graphql-codegen/gql-tag-operations |
6.0.0-alpha-20260323113908-33f45bf480eca7cc9aef160da1e6e7c91c33a326 |
npm ↗︎ unpkg ↗︎ |
@graphql-codegen/typescript-operations |
6.0.0-alpha-20260323113908-33f45bf480eca7cc9aef160da1e6e7c91c33a326 |
npm ↗︎ unpkg ↗︎ |
@graphql-codegen/typescript-resolvers |
6.0.0-alpha-20260323113908-33f45bf480eca7cc9aef160da1e6e7c91c33a326 |
npm ↗︎ unpkg ↗︎ |
@graphql-codegen/typed-document-node |
7.0.0-alpha-20260323113908-33f45bf480eca7cc9aef160da1e6e7c91c33a326 |
npm ↗︎ unpkg ↗︎ |
@graphql-codegen/typescript |
6.0.0-alpha-20260323113908-33f45bf480eca7cc9aef160da1e6e7c91c33a326 |
npm ↗︎ unpkg ↗︎ |
@graphql-codegen/client-preset |
6.0.0-alpha-20260323113908-33f45bf480eca7cc9aef160da1e6e7c91c33a326 |
npm ↗︎ unpkg ↗︎ |
@graphql-codegen/graphql-modules-preset |
6.0.0-alpha-20260323113908-33f45bf480eca7cc9aef160da1e6e7c91c33a326 |
npm ↗︎ unpkg ↗︎ |
@graphql-codegen/testing |
5.0.0-alpha-20260323113908-33f45bf480eca7cc9aef160da1e6e7c91c33a326 |
npm ↗︎ unpkg ↗︎ |
@graphql-codegen/plugin-helpers |
7.0.0-alpha-20260323113908-33f45bf480eca7cc9aef160da1e6e7c91c33a326 |
npm ↗︎ unpkg ↗︎ |
There was a problem hiding this comment.
These got automatically generated in CI. I thought they were created on the master-next branch already 🤔
I will keep them here to avoid issues.
| shasum.update(operation); | ||
| return shasum.digest('hex'); | ||
|
|
||
| const algorithmPrefix = algorithm === 'sha256' ? 'sha256:' : ''; |
There was a problem hiding this comment.
From the spec:
The {prefix}
identifies the method of identification used. Applications may use their own
identification methods by ensuring that the prefix startsx-; otherwise, all
prefixes are reserved for reasons of future expansion.
I would advise avoiding having a : in the doc ID at all for SHA1, but you can do x-sha1: or x-guild-sha1: or similar instead if you want. (Later you can propose we adopt sha1: as a supported prefix if you want.)
(What you have currently looks correct.)
There was a problem hiding this comment.
Ah thanks for the extract from spec. Makes sense!
I'll keep it as-is then, thanks for your advice 🙏
💻 Website PreviewThe latest changes are available as preview in: https://pr-10652.graphql-code-generator.pages.dev |
Description
This PR changes the default hashing algorithm for persisted docs to sha256 and follow the format in the GraphQL-over-http doc
Related #10496
Type of change