Skip to content

Commit d141ed6

Browse files
authored
fix: resolveClient throwing too soon, fix #1557 (#1570)
1 parent c8e5106 commit d141ed6

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

packages/vue-apollo-composable/src/useApolloClient.ts

+1-4
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,7 @@ function resolveDefaultClient<T> (providedApolloClients: ClientDict<T> | null, p
2323
}
2424

2525
function resolveClientWithId<T> (providedApolloClients: ClientDict<T> | null, clientId: ClientId): NullableApolloClient<T> {
26-
if (!providedApolloClients) {
27-
throw new Error(`No apolloClients injection found, tried to resolve '${clientId}' clientId`)
28-
}
29-
return providedApolloClients[clientId]
26+
return providedApolloClients?.[clientId]
3027
}
3128

3229
export function useApolloClient<TCacheShape = any> (clientId?: ClientId): UseApolloClientReturn<TCacheShape> {

0 commit comments

Comments
 (0)