8000 feat: add relay persisted_query extension by Miaxos · Pull Request #641 · async-graphql/async-graphql · GitHub
[go: up one dir, main page]

Skip to content

feat: add relay persisted_query extension #641

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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Miaxos
Copy link
Member
@Miaxos Miaxos commented Sep 20, 2021

A draft to add relay persisted Query extension.

The purpose is to check if this could solve #637
If it's in the right way, test are to be added and the allowlist should also be implemented.

It's only slightly different than Apollo's version, so maybe merge them later?

@Miaxos Miaxos mentioned this pull request Sep 20, 2021
@maraisr
Copy link
Contributor
maraisr commented Sep 20, 2021

Just double checking here — this isnt in query execution time. The query is uploaded via FormData well and truely before its execution time.

At runtime, the query is in fact sent via the id property. Perhaps im missing the mark, but Apollo and Relay persistence layers are very different concepts.

@Miaxos
Copy link
Member Author
Miaxos commented Sep 20, 2021

Yep you are right, I didn't understand you only wanted the endpoint to store the queries.

But for async-graphql to work when a relay client ask for a persisted query, you'll need an extension like this.

At runtime, the query is in fact sent via the id property

The query is sent with the id property when compiling but with a doc_id from a relay client (from the documentation)
image

@Miaxos Miaxos closed this Sep 20, 2021
@Miaxos Miaxos reopened this Sep 20, 2021
@maraisr
Copy link
Contributor
maraisr commented Sep 20, 2021

A consumer 100% controls the network layer — we can send whatever we'd like. doc_id is a facebook way, and 100% just for illustration. If async-graphql want to standardize on id, that is more than fine. Heck you could even make that field configurable.

@maraisr
Copy link
Contributor
maraisr commented Aug 23, 2022

hi @Miaxos was wondering if you're still looking after this? If not, id be more than happy to fork your PR and help ship this across the finishing line 🚀

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
0