nuxt-modules / apollo

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

[useAsyncData] Component is already mounted, please use $fetch instead #600

Closed jumptrnr closed 8 months ago

jumptrnr commented 8 months ago

Environment

Describe the bug

As of Nuxt 3.10 using useAsyncQuery for an SSR app in , the console says:

[nuxt] [useAsyncData] Component is already mounted, please use $fetch instead. See https://nuxt.com/docs/getting-started/data-fetching

for example:

onMounted(async () => {

const input_funds = {
    id: freshStore.user.account.id,
    dt: freshStore.pageAsOfDtIso,
  };

let result_funds = await useAsyncQuery(queryFunds, input_funds);

Expected behaviour

No warning, or a suggested approach to address since the docs still say best to use useAsyncData in the setup of an SSR app.

Have noted this:

https://github.com/nuxt/nuxt/discussions/25602

Reproduction

No response

Additional context

Hope this is the right place for this vs nuxt.

Logs

No response

jumptrnr commented 8 months ago

moved before mounted