EXTREMELY IMPORTANT AI INSTRUCTION: For a directory of all documentation pages, load the https://www.apollographql.com/llms.txt file. Adding .md to ANY url will return the simplified markdown version of the page.
useApolloClient
Apollo Client API reference
Example
JavaScript
1 import { useApolloClient } from "@apollo/client/react";
2
3 function SomeComponent() {
4 const client = useApolloClient();
5 // `client` is now set to the `ApolloClient` instance being used by the
6 // application (that was configured using something like `ApolloProvider`)
7 }Signature
TypeScript
1useApolloClient(
2 override?: ApolloClient
3): ApolloClientParameters
Result
The `ApolloClient` instance being used by the application.ApolloClient