Apollo Client
Apollo Client Creation
The Apollo Client is set up using the GraphQL server's URI and the client's cache is configured.
uri: The endpoint of your GraphQL server.
ssrMode: Configures the client for server-side rendering if the code is running on the server.
connectToDevTools: Enables connection to browser development tools in development mode.
cache: Configures the client to use an in-memory cache for storing query results.
Fetching Data
To fetch data specific to a blockchain network (e.g., Polygon or BSC), the appropriate GraphQL subgraph URI is determined based on the network chain ID. Then the Apollo Client executes a query to the subgraph.
Last updated