-
Notifications
You must be signed in to change notification settings - Fork 198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The useQuery composable not recognizing clients. #550
Comments
For what it's worth, I'm fighting with the same situation. I'm totally new to nuxt, so some user error is likely on my behalf. |
Same problem here. useQuery composable does not work. It says @vue/apollo-composable is missing. |
Any news? |
I remember I already encountered this problem and I'm surprised it's still a thing. I thought it was going be a quickly solved as it's an essential composable. But this issue has been present for several months now. |
Also experiencing this! |
For what it's worth, I think I found a work-around. When you install
With this version, things appear to be working again! |
hitting the same issue it's unsable at the moment ... |
This fixed the issue for me |
More possibly useful info, if you need the latest version of // plugins/apollo.client.ts
import { provideApolloClients } from '@vue/apollo-composable';
export default defineNuxtPlugin((nuxtApp) => {
// @ts-expect-error nuxt-apollo module needs updated types
provideApolloClients(nuxtApp.$apollo.clients);
}); |
This issue is fixed and a workaround is no longer required in my project on the latest version! |
@Diizzayy Looks like this issue is appearing again. 😢 I did a little more investigating and I think I know why. The I feel a possible long-term solution to this problem would be to make This also means there is yet another workaround for people like me... if you set the "overrides": {
"@vue/apollo-composable": "^4.0.0-beta.12"
} |
Thanks a lot @danielwaltz it has resolved issue. Now I am able to use useMutation with clientId. |
Environment
Describe the bug
I'm trying to perform a simple API call with
useQuery
composable. First of all, to use this composable I need to install@vue/apollo-composable
with--force
in order to be able to useuseQuery
. There is no mention of this in the documentation. The main problem is as follows. These are my configs:nuxt.config.ts:
apollo/clients/default.ts:
apollo/clients/rick.ts:
And this is the setup script of my
test.vue
page:Instead of getting the standard response object in browser console, I'm getting this error:
Uncaught (in promise) Error: No apolloClients injection found, tried to resolve 'rick' clientId
Expected behaviour
I'm not getting the expected response from
useQuery
request as described in "Describe the bug" section. I provided the used version of all packages inside the "Environment" section.Reproduction
No response
Additional context
No response
Logs
No response
The text was updated successfully, but these errors were encountered: