nuxt-modules / apollo

Nuxt.js module to use Vue-Apollo. The Apollo integration for GraphQL.
https://apollo.nuxtjs.org
MIT License
945 stars 199 forks source link

No Cache Data available #472

Closed thibault60000 closed 7 months ago

thibault60000 commented 1 year ago

Environment

Nuxt 3 project


Describe the bug

I don't have data writted on the Apollo Cache with the nuxt config :

    clients: {
            default: {
                authType: 'Bearer', // Default
                authHeader: 'Authorization', // Default,
                tokenStorage: 'cookie', // Default and required for SSR
                httpEndpoint: 'http://localhost:1500/api/graphql',
                httpLinkOptions: {
                    fetchOptions: {
                        mode: 'cors',
                    },
                },
                connectToDevTools: true, // Default
            },
        },
    },

I used useLazyAsyncQuery on my vue component But on the plugin I don't have cache data :/

Capture d’écran 2023-02-02 à 22 53 01

And I have 0 query, 0 mutation

But if I try a query on the plugins apollo playground, I have 1 query but 0 cache data

Capture d’écran 2023-02-02 à 22 54 29

Expected behaviour

I want to save my query data by default on the Apollo Cache

Reproduction

const { data, pending, error } = await useLazyAsyncQuery(query, variables, {
    fetchPolicy: 'cache-first',
})

or just

const { data, pending, error } = await useLazyAsyncQuery(query, variables)

Additional context

No response

Logs

No response

matiyin commented 1 year ago

+1 i experience the same all the same versions and setup excluding tailwind. Keeps reloading the data of each page and no caching is done. Same result with useQuery.

keithmifsud commented 1 year ago

+1 Cannot even see the Apollo tab in dev tools.

yazer79 commented 1 year ago

no update on this?