-
Notifications
You must be signed in to change notification settings - Fork 478
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 Apollo with Next.js getServerSideProps #215
Comments
Yes, we are aware of this issue and we're working on coming up with a solution with examples for users. Though, in practice |
Do you have any examples of how this could be done? I'm having a hard time figuring out this part:
|
@EvHaus I just used the nhost client for that (Keep in mind: request will be sent with the "public" role):
And then use it in your page component via props: You can read more about the nhost sdk-client in the docs. |
Hello, |
I'm trying to get
@nhost/react-apollo
working with Next.js'sgetServerSideProps
so that I can fetch my data on the server-side and feed it to Apollo on the client to avoid the initial loading state that appears.Looking at the Next.js Apollo example, I can see this is possible: https://github.com/vercel/next.js/tree/canary/examples/with-apollo
However, from what I can tell, the way they do this seems to be incompatible with
@nhost/react-apollo
because nhost's library doesn't provide any mechanism to access the client (which is needed forgetServerSideProps
).Is this something the nhost team is aware of and planning to add support for in the future?
The text was updated successfully, but these errors were encountered: