-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
@defer
support
#2624
@defer
support
#2624
Conversation
Hi, Is you still working on this? |
I'm waiting for feedback from the maintainers. Meanwhile I'm using this myself. |
Sorry, I thought you were still working on it as it doesn't pass existing tests. I would love to have the defer feature supported, but it needs more work (e.g. passes existing tests) before I would feel comfortable merging it. Linting the generated code is a good way to find problems in the templates that sometimes are hard to see. |
Sorry, my time has expired, I don't know when I'll be able to come back to this. Hopefully soon, but if someone else wants to do it instead of me, please do it. I do get very confused about the amount of examples and test code that exist in the repository. It's hard to understand what each thing is doing. One question: do we need this to work with HTTP? I had forgotten about that possibility, was only thinking about websockets and SSE. And also with |
I made a patch that should fix most of the tests, only one left, but i am not sure how to fix that one. |
I am still confused about the role of |
I am not sure about it, but its used in a test |
@UnAfraid I don't think your patch actually causes the tests to pass? I applied it locally, committed it, and pushed it to a branch (and then I ran Try this:
|
@StevenACoffman here i've made a branch with my changes applied and also latest master changes |
Closed in favor of #2642 |
This implements
@defer
support according to https://github.com/graphql/graphql-wg/blob/66a80c7e7ff5d881a7de515eec991ca3150c829b/rfcs/DeferStream.mdThere are no tests and there may be some bugs yet, but I'm just opening this to ask if this change is desired and/or if the code quality is too bad to be considered -- before I put more time polishing it and writing tests.
(Don't look at the first commit, please, just look at the final result.)
There is a demo app at https://github.com/fiatjaf/gqlgen-defer-demo, you can try it live on https://defer.fiatjaf.com/debug/. Only the fields
availability
,here
andthere
are concurrent, so they're the only ones that can be deferred (the others will just return in the normal response regardless). Try the queryscreencast.mp4
I have: