graphql-code-generator
graphql-code-generator copied to clipboard
Support @defer and @stream in operations plugin
defer and stream are close to land and should be correctly supported within the code output.
Is there a theory of roughly what sorts of types should be generated for incremental delivery operations?
@hwillson 😍 any way to support you on this?
@glasser for @defer at least it's pretty basic, the deferred fields need to be made optional and that's all. Per the apollo documentation:
Our deferred fields will not exist as keys on data yet [...]
https://www.apollographql.com/docs/react/data/defer/
+1 to the previous question — @hwillson, do you think you're gonna continue working on adding defer support and is there any way to help you?
Is defer supported now? Looking at the PR referenced and this example https://github.com/dotansimha/graphql-code-generator/tree/master/examples/react/apollo-client-defer.
Yes, we will release it today 😇
@n1ru4l I am still unable to use the defer directive with the latest version of graphql-codegen. I see the event streams coming in but I think Apollo is having an issue parsing the data that is returned.
This is the error:
ServerParseError: Network Error: Please try again
at JSON.parse (<anonymous>)
at parseJsonBody (webpack-internal:///../../node_modules/@apollo/client/link/http/parseAndCheckHttpResponse.js:134:21)
at eval (webpack-internal:///../../node_modules/@apollo/client/link/http/parseAndCheckHttpResponse.js:167:48)
Hi there @jennyk1 👋 I work on Apollo Client and it looks like your server is using SSE to communicate with the client which isn't supported out of the box.
Can you please open an issue over on the Apollo Client repository since this issue doesn't have to do with codegen? Thanks!