react-relay-network-modern
react-relay-network-modern copied to clipboard
Support for something like @defer?
Hi!
I was wondering if it would be possible to somehow support something like https://github.com/relay-tools/fetch-multipart-graphql in order to support the @defer directive. Would that change be too invasive on this code base, or would it be possible to implement in a sane way?
Thanks!
Need to experiment with RelayResponse and its data property. Maybe if we put there Observable it will work. But for now, I have no free time for such experiments.
Needs to create createFromObservable method like it did with createFromGraphQL for ssr with graphql-js:
https://github.com/relay-tools/react-relay-network-modern/blob/master/src/RelayResponse.js#L36
And try to set r.data equal to Observable.
If it will work, then need to write a 3rd party middleware like it did with https://github.com/relay-tools/react-relay-network-modern-ssr
Will glad to any help.
Thank you for your reply! I'll have a look as soon as I find the time and get back to you with any findings/question.
Bumping this now that @apollo/server can support the @defer directive, any work planned here?
Bumping this now that @apollo/server can support the @defer directive, any work planned here?
It seems like just returning an Observable from beforeFetch works but the types aren't correct
Any news on this? 👀
I got defer to work in the backend using apollo server. The relay network layer doesn't seam to parse the responses properly as it throws the error SyntaxError: No number after minus sign in JSON at position 3 (line 2 column 2).