Hi @dohomi
First, to make the apollo-client works on the server-side, you need to polyfill fetch, you can do it by installing the isomorphic-fetch module.
Then, you need the apollo-client and graphql-tag module. you can add them in your nuxt.config.js file in the build.vendor section.
I created an example for you so you can see how it works: https://gomix.com/#!/project/nuxt-apollo-client
Live demo: https://nuxt-apollo-client.gomix.me/
I created the ~plugins/apolloClient.js to create the connection and re-use it in every pages components.
Great stuff, thanks @Atinux
There is this plugin https://github.com/nuxt-community/apollo-module which you can use.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Most helpful comment
Hi @dohomi
First, to make the
apollo-clientworks on the server-side, you need to polyfillfetch, you can do it by installing the isomorphic-fetch module.Then, you need the
apollo-clientandgraphql-tagmodule. you can add them in yournuxt.config.jsfile in thebuild.vendorsection.I created an example for you so you can see how it works: https://gomix.com/#!/project/nuxt-apollo-client
Live demo: https://nuxt-apollo-client.gomix.me/
I created the
~plugins/apolloClient.jsto create the connection and re-use it in every pages components.