Closed mishingo closed 5 years ago
@mishingo it depends on how do you use apollo. It should work if you are making apollo request inside of asyncData. But you'll need axios installed anyway. Please, share example of your page component.
I went ahead and figured it out:
async asyncData({ $axios, $payloadURL, route, app }) {
if (process.static && process.client) {
return await $axios.$get($payloadURL(route))
}
let gqlData = await app.apolloProvider.defaultClient.query({
query: gqlquery
})
return {
gqlData
}
}
Great plugin! Cut my page load in half
Could this be added to documentation?
@altryne added
Currently the module works with an axios request but is there a pattern that allows for Apollo with graphql?