useQuery throws error if clientId supplied
Environment
- Operating System:
Darwin - Node Version:
v18.0.0 - Nuxt Version:
3.7.4 - CLI Version:
3.9.0 - Nitro Version:
2.6.3 - Package Manager:
[email protected] - Builder:
- - User Config:
extends,devtools,typescript,ssr,modules,alias,build,app,runtimeConfig,sourcemap,apollo,vite - Runtime Modules:
@nuxtjs/[email protected],@pinia/[email protected],@pinia-plugin-persistedstate/[email protected],[email protected],@nuxtjs/[email protected],() - Build Modules:
-
Describe the bug
I have multiple graphql client configured. If I use useAsyncQuery supplying clientId it works const res = await useAsyncQuery(GET_EVENT(evParam), "cmsApollo");
If I use useQuery supplying clientId I get error - Error: No apolloClients injection found, tried to resolve 'cmsApollo' clientId
const res = useQuery( GET_EVENT(evParam), {}, { clientId: "cmsApollo" } ); Error: No apolloClients injection found, tried to resolve 'cmsApollo' clientId
Expected behaviour
useQuery should work with clientId
Reproduction
No response
Additional context
No response
Logs
No response
@Diizzayy Both URLs point to the same GitHub repository but diff steps to configure client. https://nuxt.com/modules/apollo https://apollo.nuxtjs.org/getting-started/quick-start https://github.com/Diizzayy/nuxt-graphql-client Question: Which one is recommended for a MultiClient setup? I followed this quick start guide, and it works with "@vue/apollo-composable": "4.0.0-beta.12". While useAsyncQuery works, useQuery does not, which is discussed in this GitHub issue. However, when I upgraded from Nuxt 3.7 to 3.11, useAsyncQuery stopped working. The following code throws an error for the supplied client ID cmsApollo: const res = await useAsyncQuery(GET_ACCOUNT(accParam), "cmsApollo"); Please provide your input on which approach I should follow to ensure smooth future upgrades of Nuxt.