Skip to content

Commit

Permalink
fix(useApolloClient): clientId arg not working, closes #1023
Browse files Browse the repository at this point in the history
  • Loading branch information
Akryum committed Oct 15, 2020
1 parent c9ee0ec commit 65d1984
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/vue-apollo-composable/src/useApolloClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export function useApolloClient<TCacheShape = any>(clientId?: ClientId): UseApol

function resolveClient() {
if (clientId) {
resolveClientWithId(providedApolloClients, clientId)
return resolveClientWithId(providedApolloClients, clientId)
}
return resolveDefaultClient(providedApolloClients, providedApolloClient)
}
Expand Down

2 comments on commit 65d1984

@shenie
Copy link

@shenie shenie commented on 65d1984 Oct 16, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've tried this change to see if it fixes using non-default client but unfortunately it is still not fixed.

I think it is because the resolveClient function is still been called with clientId
e.g. https://github.com/vuejs/vue-apollo/blob/65d1984ecdd67371db3aa0cd6f8814d6709eb15a/packages/vue-apollo-composable/src/useQuery.ts#L180 ....

@Akryum
Copy link
Member Author

@Akryum Akryum commented on 65d1984 Oct 16, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have another commit I didn't push yet to complement this fix. :)

Please sign in to comment.