-
Notifications
You must be signed in to change notification settings - Fork 787
Example for Next.js #295
Comments
I'd love that! Been wanting to try out next.js! |
@sedubois do you have any links or any idea what would need to be added? |
@jbaxleyiii Well, this works but I guess it creates a separate Apollo store per page... |
Does that work with SSR out of the box? |
@jbaxleyiii yes, at least that is the claim |
Does Next have an example with Redux? I imagine Apollo would be initialized and provided in exactly the same way. |
Indeed, here it is: https://github.com/zeit/next.js/wiki/Redux-example The Redux client-side trick is:
So I guess the only choice is to manually configure Apollo with such an external store: I propose to close this and any next.js Apollo example could be added in their wiki. |
The example is being developed here, and it's not trivial: |
Cool, let me know if I can help at all, other than the SSR bug. But yeah, attaching the store as a global variable could work I suppose. Just need to make sure it doesn't end up setting a global variable on the server during SSR! |
Thanks 😊 discussion continues in that other thread. |
The new next.js framework looks quite promising, it would be awesome to have an example of integration with Apollo 😃 Especially as it does not (currently) expose a root-level routing component. (please close issue if you think it should be figured out on next.js side...)
The text was updated successfully, but these errors were encountered: