nuxt3-apollo-module icon indicating copy to clipboard operation
nuxt3-apollo-module copied to clipboard

Doesnt properly work with ssr: false; nuxt3

Open steinathan opened this issue 3 years ago • 2 comments

Disabling ssr ( ssr: false) produces this error

Unexpected token u in JSON at position 0

commenting out this line works

 cache.restore(JSON.parse(JSON.stringify(nuxt.payload.data["apollo-" + clientId])));

Screenshot from 2022-07-20 14-02-20

Not sure why this happened

steinathan avatar Jul 20 '22 13:07 steinathan

Forking and adding replacing this line temporarily fixed my problem

      const cacheData = JSON.stringify(nuxt.payload.data["apollo-" + clientId] ?? {})
      cache.restore(JSON.parse(cacheData));

steinathan avatar Jul 20 '22 13:07 steinathan

Forking and adding replacing this line temporarily fixed my problem

      const cacheData = JSON.stringify(nuxt.payload.data["apollo-" + clientId] ?? {})
      cache.restore(JSON.parse(cacheData));

Could you send PR?

Luferov avatar Aug 30 '22 14:08 Luferov