Vue-apollo: Prefetch not working?

Created on 22 May 2019  路  5Comments  路  Source: vuejs/vue-apollo

Copying this from @homerjam https://github.com/nuxt-community/apollo-module/issues/210

But am experiencing on a project. We are moving from a custom built SSR to nuxt and we are unable to get the state of our apollo queries before the component renders.

In our beforeNuxtRender the value of the cache.extract() is an empty object.

  beforeNuxtRender(({
      nuxtState
    }) => {
      nuxtState.apollo = ApolloSSR.getStates(apolloProvider);
    });
  }

Screenshot from 2019-05-22 16-29-33

need repro

All 5 comments

I'm finding this within the computed property, which ends up throwing a nuxt error (blanking the entire page)

Can't reproduce:

image

@Akryum the issue refers to SSR - I'm not sure why but we no longer seem to get the server side console.log in CodeSandbox. Previously it read:

server: true allCars: undefined

Possibly you only get it in editor mode??

Well, when the component instance is created on the server, the data isn't available in the created hook because the apollo query needs to be completed and it takes time.

Does that mean vue-apollo officially doesn't support SSR - eg. Nuxt universal?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

danthareja picture danthareja  路  4Comments

ScreamZ picture ScreamZ  路  4Comments

Akryum picture Akryum  路  3Comments

wangxiangyao picture wangxiangyao  路  4Comments

chadwtaylor picture chadwtaylor  路  3Comments