Skip to content
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

Support defer directives #110

Open
LouisIV opened this issue Jul 27, 2023 · 1 comment
Open

Support defer directives #110

LouisIV opened this issue Jul 27, 2023 · 1 comment

Comments

@LouisIV
Copy link

LouisIV commented Jul 27, 2023

Is your feature request related to a problem? Please describe.
Currently the extension doesn't support @defer directives. wg-doc. These are supported by the Apollo suite of tools.

Essentially they send multiple payloads using multipart form data. They look like the following when the client has the defer support active but not in use (when the @defer directive isn't used in the query):

--graphql
content-type: application/json

{"data":{"me":{"__typename":"User","role":"ADMIN","username":"-","createdAt":"2023-03-20T21:57:49.466Z","updatedAt":"2023-07-27T15:41:06.231Z"}}}
--graphql--

There is more information in the working group doc about multi part responses.

Describe the solution you'd like
I'd really hope that at least in the first iteration queries using this multipart system are supported. Not necessarily the ones using @defer. Currently all entries in the extension just show empty responses whenever this spec is enabled.

Describe alternatives you've considered
The apollo graphql extension and Urql extensions support this spec but they require you to modify your application bundle and aren't nearly as cool as this extension.

Additional context
image

image

I'm willing to work on this a bit but it requires re-writing a lot of the multipart support logic so I'd like some input from the maintainers on how they'd like that to be re-structured before I dive into it.

@warrenday
Copy link
Owner

Hey @LouisIV

Thanks for raising the issue. We haven't added any support for defer directives.

The multipart code is fairly new, I've got no issue with you rewriting the logic.

If you want to go ahead with a PR that would be great.

I'm here to support with any queries on the codebase or anything else in general.

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

No branches or pull requests

2 participants