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 and @stream in operations plugin #7885

Closed
Tracked by #8296 ...
n1ru4l opened this issue May 25, 2022 · 7 comments
Closed
Tracked by #8296 ...

Support @defer and @stream in operations plugin #7885

n1ru4l opened this issue May 25, 2022 · 7 comments
Labels
core Related to codegen core/cli

Comments

@n1ru4l
Copy link
Collaborator

n1ru4l commented May 25, 2022

defer and stream are close to land and should be correctly supported within the code output.

@glasser
Copy link

glasser commented Aug 16, 2022

Is there a theory of roughly what sorts of types should be generated for incremental delivery operations?

@charlypoly charlypoly added the core Related to codegen core/cli label Nov 3, 2022
hwillson added a commit to hwillson/graphql-code-generator that referenced this issue Jan 3, 2023
This commit takes a first pass at introducing `@defer` typescript codegen
support. It follows a similar approach as the `@skip` / `@include`
functionality introduced in dotansimha#5017.

Related issue: dotansimha#7885
hwillson added a commit to hwillson/graphql-code-generator that referenced this issue Jan 9, 2023
This commit takes a first pass at introducing `@defer` typescript codegen
support. It follows a similar approach as the `@skip` / `@include`
functionality introduced in dotansimha#5017.

Related issue: dotansimha#7885
hwillson added a commit to hwillson/graphql-code-generator that referenced this issue Jan 9, 2023
This commit takes a first pass at introducing `@defer` typescript codegen
support. It follows a similar approach as the `@skip` / `@include`
functionality introduced in dotansimha#5017.

Related issue: dotansimha#7885
hwillson added a commit to hwillson/graphql-code-generator that referenced this issue Jan 22, 2023
This commit takes a first pass at introducing `@defer` typescript codegen
support. It follows a similar approach as the `@skip` / `@include`
functionality introduced in dotansimha#5017.

Related issue: dotansimha#7885
hwillson added a commit to hwillson/graphql-code-generator that referenced this issue Jan 22, 2023
This commit takes a first pass at introducing `@defer` typescript codegen
support. It follows a similar approach as the `@skip` / `@include`
functionality introduced in dotansimha#5017.

Related issue: dotansimha#7885
hwillson added a commit to hwillson/graphql-code-generator that referenced this issue Jan 24, 2023
This commit takes a first pass at introducing `@defer` typescript codegen
support. It follows a similar approach as the `@skip` / `@include`
functionality introduced in dotansimha#5017.

Related issue: dotansimha#7885
@marcesengel
Copy link

@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/

@beerose
Copy link
Contributor

beerose commented Mar 13, 2023

+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?

beerose pushed a commit that referenced this issue Mar 17, 2023
This commit takes a first pass at introducing `@defer` typescript codegen
support. It follows a similar approach as the `@skip` / `@include`
functionality introduced in #5017.

Related issue: #7885
@alesso-x
Copy link

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.

@n1ru4l
Copy link
Collaborator Author

n1ru4l commented May 24, 2023

Yes, we will release it today 😇

@jennyk1
Copy link

jennyk1 commented May 16, 2024

@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.

Screenshot 2024-05-16 2 50 35 PM
Screenshot 2024-05-16 2 50 31 PM

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)

@alessbell
Copy link

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Related to codegen core/cli
Projects
None yet
Development

No branches or pull requests

8 participants