-
Notifications
You must be signed in to change notification settings - Fork 575
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
feat(persisted-operations): ability to support different specifications #1610
Conversation
🦋 Changeset detectedLatest commit: 4cc2c1e The changes in this PR will be included in the next version bump. This PR includes changesets to release 15 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 |
The latest changes of this PR are not available as canary, since there are no linked |
✅ Benchmark Results
|
🚀 Snapshot Release (
|
Package | Version | Info |
---|---|---|
@graphql-yoga/apollo-link |
1.0.0-alpha-20220906121446-3de60b56 |
npm ↗︎ unpkg ↗︎ |
@graphql-yoga/urql-exchange |
1.0.0-alpha-20220906121446-3de60b56 |
npm ↗︎ unpkg ↗︎ |
@graphql-yoga/common |
3.0.0-alpha-20220906121446-3de60b56 |
npm ↗︎ unpkg ↗︎ |
@graphql-yoga/graphiql |
2.4.3-alpha-20220906121446-3de60b56 |
npm ↗︎ unpkg ↗︎ |
graphql-yoga |
3.0.0-alpha-20220906121446-3de60b56 |
npm ↗︎ unpkg ↗︎ |
@graphql-yoga/node |
3.0.0-alpha-20220906121446-3de60b56 |
npm ↗︎ unpkg ↗︎ |
@graphql-yoga/plugin-apollo-inline-trace |
1.0.0-alpha-20220906121446-3de60b56 |
npm ↗︎ unpkg ↗︎ |
@graphql-yoga/plugin-apq |
1.0.0-alpha-20220906121446-3de60b56 |
npm ↗︎ unpkg ↗︎ |
@graphql-yoga/plugin-persisted-operations |
1.0.0-alpha-20220906121446-3de60b56 |
npm ↗︎ unpkg ↗︎ |
@graphql-yoga/plugin-response-cache |
1.0.0-alpha-20220906121446-3de60b56 |
npm ↗︎ unpkg ↗︎ |
@graphql-yoga/render-graphiql |
3.0.0-alpha-20220906121446-3de60b56 |
npm ↗︎ unpkg ↗︎ |
In @graphile/persisted-operations we try and use whichever is provided of both: function defaultHashFromPayload(payload: RequestPayload) {
return (
// https://github.com/apollographql/apollo-link-persisted-queries#protocol
payload?.extensions?.persistedQuery?.sha256Hash ||
// https://relay.dev/docs/en/persisted-queries#network-layer-changes
payload?.documentId
);
} |
Drop
store
in favor of more genericgetPersistedOperation
that takeskey
that is generated bygetPersistedOperationKey
function. The other function takes parsed request body.This makes Persisted Operations plugin support different specification in a future proof approach. If there is another more "official" spec is introduced by GraphQL, this plugin will be able to support that with a few configuration.