-
-
Notifications
You must be signed in to change notification settings - Fork 522
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
useQuery is crashing if clientId is set in the options #1557
Closed
tukanoidd opened this issue
Jun 5, 2024
· 1 comment
· Fixed by #1570, Shoutzor/frontend#175, Shoutzor/frontend#179 or Shoutzor/frontend#181
Closed
useQuery is crashing if clientId is set in the options #1557
tukanoidd opened this issue
Jun 5, 2024
· 1 comment
· Fixed by #1570, Shoutzor/frontend#175, Shoutzor/frontend#179 or Shoutzor/frontend#181
Comments
I have the same problem using It seems like everything is working as expected with at least vue 3.4.26 to I'm not sure if this is an apollo or vue issue?! |
Akryum
added a commit
that referenced
this issue
Aug 19, 2024
This was referenced Sep 11, 2024
This was referenced Sep 19, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
I'm working on a web app. I need to mock graphql requests in those tests. I use mock-apollo-client with @vue/apollo-composables. It only breaks in tests, not dev/production builds, and only when clientId is set manually (including literal "default" value) in the useQuery call.
Expected behavior
It just works?
Versions
vue: ^3.3.13
vue-apollo: ^4.0.1
@apollo/client: ^3.9.4
@vue/apollo-composable: ^4.0.1
Additional context
After hours of searching for information and debuggin the code, I think I found the source of the issue:
apollo/packages/vue-apollo-composable/src/useApolloClient.ts
Line 46 in 6fa46ab
apollo/packages/vue-apollo-composable/src/useApolloClient.ts
Line 27 in 6fa46ab
apollo/packages/vue-apollo-composable/src/useApolloClient.ts
Line 52 in 6fa46ab
apollo/packages/vue-apollo-composable/src/useApolloClient.ts
Line 21 in 6fa46ab
apollo/packages/vue-apollo-composable/src/useApolloClient.ts
Line 61 in 6fa46ab
Proposed solution
Don't throw in resolveClientWithId and use a similar hack like in resolveDefaultClient, or throw the error after both resolvers fail, not after the first one.
EDIT: pretty sure it's the same issue as here, although I might be wrong
The text was updated successfully, but these errors were encountered: