-
Notifications
You must be signed in to change notification settings - Fork 36
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
Using with apollo codegen #22
Comments
We removed support for the Apollo Codegen last year and instead recommend using
Generally, if you configure the Graphql Codegen like we show here in our documentation, the codegen will generate your queries with a correctly typed You can then call |
I've implemented this into my app. Perhaps this is a codegen issue, but it would be nice if codegen generated typed |
can u perhaps share your setup and how you're using it? |
@phryneas thanks, it seems to be working, though there are two issues:
|
@nick4fake take a look at the codegen config we have in the examples. We do not generate any hooks. That's not necessary to get correct types - you just have the codegen to generate a correctly typed Mutations don't need any extra treatment since you would never trigger a mutation during a render - neither in RSC nor in SSR. You would only trigger that browser-side in a client component, as the result of a user interaction. |
We need the functionality in graphql-codegen to generate not only Documents, but hooks too for simple usage. |
But if it creates hooks you won't be able to them in server components which is the point of this library isnt it? |
As I understand this library able to create isomorphic Apollo client that could be used both on the server and on the client. It also provides their "useQuery" and rehidtate Apollo store, that could be modified with client side only |
@ctretyak That should be typed, assuming that If that doesn't work, make sure that you have installed @ctretyak @cordial Usage between React Server Components and Client Components differs - in a server component you would not use hooks, but For more info, please see the README at the root of this repo. |
I'm curious if anyone has this working alongside apollo codegen and if they wouldn't mind sharing their configuration. Cheers!
The text was updated successfully, but these errors were encountered: