-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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 #269
Comments
This is the repository for the specification, for the JavaScript implementation you probably want https://github.com/graphql/graphql-js |
Yes there are plans but no concrete date. Stay tuned for the beginning of an RFC, but I plan on running some further experiments before then. |
@leebyron Now 2 years later, seeing defer pop up in graphql-java, go and other languages implementations I'd like to hear what's the status of defer for the reference JS implementation? I hope somebody is prioritizing it, since defer is kind of an important feature. |
There hasn’t been any discussion of defer as a spec proposal for years. It was trialed in some other libraries with mixed results. If, since then, there has been enough success with a trial implementation, then I really hope the people working on that contribute an RFC to discuss standardizing it |
Typically graphql.js only implements specified graphql along with some opt-in use of changes that are being discussed as spec RFC |
Thanks for the quick answer. I just don't get it. In the new "F8 2019: Building the New Facebook.com with React, GraphQL and Relay" video defer is being talked about it as one of the core functionalities, and as if it's already implemented and something facebook is already using https://youtu.be/WxPtYJRjLL0?t=696 Take a facebook graphql-client such as Relay... with the new useQuery hooks in relay-experimental (which apparantly facebook is using acc. to the video) they integrate with React Suspense, and in their recent commits there are references to defer everywhere. Also how else would they make those progressive loaded views they present at that talk. I'm just saying... clearly facebook has it working already, and for some time now, then why not share it with the graphql community, so we don't have to send multiple queries to be able to load slow data without block rendering and without the workaround of doing multiple queries - or look to other languages for server implementations. Doesn't really make sense for me that this has been postponed so long - it should be one of the most important features. Unfortunately I do not have the technical skills to make this work myself, but for somebody with a good enough brain, I would assume it should be possible to look into graphql-java, go, or even the 1 year old PR in Apollo-server etc. solutions for inspiration, right? Also maybe facebook could drive this, since they have a solution for themselves. Love GraphQL but not having defer is a huge limitation when building modern UI's. |
That’s good to hear, actually. I haven’t been involved with the new Facebook project. Last I worked on Relay we attempted to trial implement defer as a build time transform. That sort of worked, but had some serious limitations. There never was server support. If that’s changed, then I hope someone at Facebook who worked on it can help standardize it. |
@BruceL33t Thanks for watching! A bit more context: as implied from the talk, at Facebook we are currently experimenting with support for |
We are working on this in our .net implementation (Hot Chocolate). The With the Apollo approach Although, deferral of content can although be done through batching I find the concept with a |
Defer on fragments seems to be in line with what relay/facebook is doing. And makes very good sense. |
I would like to know when and how the @defer directive can be used using the GraphQL JS library. Is there any plans to include @defer into the graphql library?
The text was updated successfully, but these errors were encountered: