<!--
  ~ Licensed to the Apache Software Foundation (ASF) under one
  ~ or more contributor license agreements.  See the NOTICE file
  ~ distributed with this work for additional information
  ~ regarding copyright ownership.  The ASF licenses this file
  ~ to you under the Apache License, Version 2.0 (the
  ~ "License"); you may not use this file except in compliance
  ~ with the License.  You may obtain a copy of the License at
  ~
  ~   http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing,
  ~ software distributed under the License is distributed on an
  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  ~ KIND, either express or implied.  See the License for the
  ~ specific language governing permissions and limitations
  ~ under the License.
-->

# Apollo – Cache Configuration

> Source: [https://www.apollographql.com/docs/react/caching/cache-configuration/](https://www.apollographql.com/docs/react/caching/cache-configuration/)
> Retrieved: 2025-11-19T07:03:02.935488Z

[ Docs  ](/docs)

[ ](/docs)

Search Apollo content (Cmd+K or /)

[Launch GraphOS Studio ](https://studio.apollographql.com/signup?referrer=docs)

[ Home Home ](/docs/)[ Schema Design Schema Design ](/docs/graphos/schema-design)[ Connectors Connectors ](/docs/graphos/connectors)[ GraphOS Platform GraphOS Platform ](/docs/graphos/platform)[ Routing Routing ](/docs/graphos/routing)[ Resources Resources ](/docs/graphos/resources)

Apollo Client (Web) Apollo Client (Web)

[Rover CLI](https://www.apollographql.com/docs/rover)[IDE Support](https://www.apollographql.com/docs/ide-support)[Apollo Client (Web)](https://www.apollographql.com/docs/react)[Apollo iOS](https://www.apollographql.com/docs/ios)[Apollo Kotlin](https://www.apollographql.com/docs/kotlin)[Apollo Server](https://www.apollographql.com/docs/apollo-server)[Apollo MCP Server](https://www.apollographql.com/docs/apollo-mcp-server)[Apollo Operator](https://www.apollographql.com/docs/apollo-operator)

Apollo Client (Web) - v4 (latest)

[Introduction](https://www.apollographql.com/docs/react)[Why Apollo Client?](https://www.apollographql.com/docs/react/why-apollo)[Get started](https://www.apollographql.com/docs/react/get-started)

### Core concepts

[Queries](https://www.apollographql.com/docs/react/data/queries)[Suspense](https://www.apollographql.com/docs/react/data/suspense)[Fragments](https://www.apollographql.com/docs/react/data/fragments)[Mutations](https://www.apollographql.com/docs/react/data/mutations)[TypeScript](https://www.apollographql.com/docs/react/data/typescript)[Refetching](https://www.apollographql.com/docs/react/data/refetching)[Subscriptions](https://www.apollographql.com/docs/react/data/subscriptions)[Directives](https://www.apollographql.com/docs/react/data/directives)[Error handling](https://www.apollographql.com/docs/react/data/error-handling)[Persisted queries](https://www.apollographql.com/docs/react/data/persisted-queries)[Document transforms](https://www.apollographql.com/docs/react/data/document-transforms)[Deferring response data](https://www.apollographql.com/docs/react/data/defer)[Best practices](https://www.apollographql.com/docs/react/data/operation-best-practices)

### Caching

[Overview](https://www.apollographql.com/docs/react/caching/overview)[Configuration](https://www.apollographql.com/docs/react/caching/cache-configuration)[Reading and writing](https://www.apollographql.com/docs/react/caching/cache-interaction)[Garbage collection and eviction](https://www.apollographql.com/docs/react/caching/garbage-collection)[Customizing field behavior](https://www.apollographql.com/docs/react/caching/cache-field-behavior)[Memory Management](https://www.apollographql.com/docs/react/caching/memory-management)[Advanced topics](https://www.apollographql.com/docs/react/caching/advanced-topics)

### Pagination

[Overview](https://www.apollographql.com/docs/react/pagination/overview)[Core API](https://www.apollographql.com/docs/react/pagination/core-api)[Offset-based](https://www.apollographql.com/docs/react/pagination/offset-based)[Cursor-based](https://www.apollographql.com/docs/react/pagination/cursor-based)[keyArgs](https://www.apollographql.com/docs/react/pagination/key-args)

### Local State

[Overview](https://www.apollographql.com/docs/react/local-state/local-state-management)[Local-only fields](https://www.apollographql.com/docs/react/local-state/managing-state-with-field-policies)[Reactive variables](https://www.apollographql.com/docs/react/local-state/reactive-variables)[Local resolvers](https://www.apollographql.com/docs/react/local-state/local-resolvers)

### Development & Testing

[Developer tools](https://www.apollographql.com/docs/react/development-testing/developer-tooling)[GraphQL Codegen](https://www.apollographql.com/docs/react/development-testing/graphql-codegen)[Testing React components](https://www.apollographql.com/docs/react/development-testing/testing)[Schema-driven testing](https://www.apollographql.com/docs/react/development-testing/schema-driven-testing)[Mocking schema capabilities](https://www.apollographql.com/docs/react/development-testing/client-schema-mocking)[Reducing bundle size](https://www.apollographql.com/docs/react/development-testing/reducing-bundle-size)

### Performance

[Improving performance](https://www.apollographql.com/docs/react/performance/performance)[Optimistic mutation results](https://www.apollographql.com/docs/react/performance/optimistic-ui)[Server-side rendering](https://www.apollographql.com/docs/react/performance/server-side-rendering)[Compiling queries with Babel](https://www.apollographql.com/docs/react/performance/babel)

### Integrations

[Using Apollo Client with your view layer](https://www.apollographql.com/docs/react/integrations/integrations)[Integrating with React Native](https://www.apollographql.com/docs/react/integrations/react-native)[Loading queries with Webpack](https://www.apollographql.com/docs/react/integrations/webpack)

### Networking

[Basic HTTP networking](https://www.apollographql.com/docs/react/networking/basic-http-networking)[Advanced HTTP networking](https://www.apollographql.com/docs/react/networking/advanced-http-networking)[Authentication](https://www.apollographql.com/docs/react/networking/authentication)

### API Reference

### Core

[ApolloClient](https://www.apollographql.com/docs/react/api/core/ApolloClient)[InMemoryCache](https://www.apollographql.com/docs/react/api/cache/InMemoryCache)[ObservableQuery](https://www.apollographql.com/docs/react/api/core/ObservableQuery)

### Errors

[CombinedGraphQLErrors](https://www.apollographql.com/docs/react/api/errors/CombinedGraphQLErrors)[CombinedProtocolErrors](https://www.apollographql.com/docs/react/api/errors/CombinedProtocolErrors)[LinkError](https://www.apollographql.com/docs/react/api/errors/LinkError)[LocalStateError](https://www.apollographql.com/docs/react/api/errors/LocalStateError)[ServerError](https://www.apollographql.com/docs/react/api/errors/ServerError)[ServerParseError](https://www.apollographql.com/docs/react/api/errors/ServerParseError)[UnconventionalError](https://www.apollographql.com/docs/react/api/errors/UnconventionalError)

### React

[ApolloProvider](https://www.apollographql.com/docs/react/api/react/ApolloProvider)[useQuery](https://www.apollographql.com/docs/react/api/react/useQuery)[useLazyQuery](https://www.apollographql.com/docs/react/api/react/useLazyQuery)[useMutation](https://www.apollographql.com/docs/react/api/react/useMutation)[useSubscription](https://www.apollographql.com/docs/react/api/react/useSubscription)[useFragment](https://www.apollographql.com/docs/react/api/react/useFragment)[useApolloClient](https://www.apollographql.com/docs/react/api/react/useApolloClient)[useReactiveVar](https://www.apollographql.com/docs/react/api/react/useReactiveVar)[useSuspenseQuery](https://www.apollographql.com/docs/react/api/react/useSuspenseQuery)[useBackgroundQuery](https://www.apollographql.com/docs/react/api/react/useBackgroundQuery)[useReadQuery](https://www.apollographql.com/docs/react/api/react/useReadQuery)[useLoadableQuery](https://www.apollographql.com/docs/react/api/react/useLoadableQuery)[useQueryRefHandlers](https://www.apollographql.com/docs/react/api/react/useQueryRefHandlers)[skipToken](https://www.apollographql.com/docs/react/api/react/skipToken)[createQueryPreloader](https://www.apollographql.com/docs/react/api/react/preloading)[MockProvider](https://www.apollographql.com/docs/react/api/react/testing)[SSR](https://www.apollographql.com/docs/react/api/react/ssr)

### Apollo Link

[Overview](https://www.apollographql.com/docs/react/api/link/introduction)[ApolloLink](https://www.apollographql.com/docs/react/api/link/apollo-link)[BaseHttpLink](https://www.apollographql.com/docs/react/api/link/apollo-link-base-http)[BaseBatchHttpLink](https://www.apollographql.com/docs/react/api/link/apollo-link-base-batch-http)[BatchHttpLink](https://www.apollographql.com/docs/react/api/link/apollo-link-batch-http)[BatchLink](https://www.apollographql.com/docs/react/api/link/apollo-link-batch)[ClientAwarenessLink](https://www.apollographql.com/docs/react/api/link/apollo-link-client-awareness)[ErrorLink](https://www.apollographql.com/docs/react/api/link/apollo-link-error)[GraphQLWsLink](https://www.apollographql.com/docs/react/api/link/apollo-link-subscriptions)[HttpLink](https://www.apollographql.com/docs/react/api/link/apollo-link-http)[PersistedQueryLink](https://www.apollographql.com/docs/react/api/link/apollo-link-persisted-queries)[RemoveTypenameFromVariablesLink](https://www.apollographql.com/docs/react/api/link/apollo-link-remove-typename)[RetryLink](https://www.apollographql.com/docs/react/api/link/apollo-link-retry)[SchemaLink](https://www.apollographql.com/docs/react/api/link/apollo-link-schema)[SetContextLink](https://www.apollographql.com/docs/react/api/link/apollo-link-context)[WebSocketLink (deprecated)](https://www.apollographql.com/docs/react/api/link/apollo-link-ws)[Community links](https://www.apollographql.com/docs/react/api/link/community-links)

[Changelog](https://github.com/apollographql/apollo-client/blob/main/CHANGELOG.md)[Migrating to Apollo Client 4.0](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration)[Versioning Policy](https://www.apollographql.com/docs/react/versioning-policy)

Navigation controls

## Schema Design

[Overview](https://www.apollographql.com/docs/graphos/schema-design)

### Federated Schemas

[Overview](https://www.apollographql.com/docs/graphos/schema-design/federated-schemas/federation)[Schema Types](https://www.apollographql.com/docs/graphos/schema-design/federated-schemas/schema-types)[Schema Composition](https://www.apollographql.com/docs/graphos/schema-design/federated-schemas/composition)[Sharing Types (Value Types)](https://www.apollographql.com/docs/graphos/schema-design/federated-schemas/sharing-types)

### Federation Reference

[Federation Changelog](https://www.apollographql.com/docs/graphos/schema-design/federated-schemas/reference/versions)[Federation Directives](https://www.apollographql.com/docs/graphos/schema-design/federated-schemas/reference/directives)[Composition Rules](https://www.apollographql.com/docs/graphos/schema-design/federated-schemas/reference/composition-rules)

### Subgraph Reference

[Federation Subgraphs Specification](https://www.apollographql.com/docs/graphos/schema-design/federated-schemas/reference/subgraph-spec)[Subgraph Specific Fields](https://www.apollographql.com/docs/graphos/schema-design/federated-schemas/reference/subgraph-specific-fields)[Compatible Subgraph Libraries](https://www.apollographql.com/docs/graphos/schema-design/federated-schemas/reference/compatible-subgraphs)

### Development and Tooling

[Query Plans](https://www.apollographql.com/docs/graphos/schema-design/federated-schemas/reference/query-plans)[Composition Hints](https://www.apollographql.com/docs/graphos/schema-design/federated-schemas/reference/hints)[Errors](https://www.apollographql.com/docs/graphos/schema-design/federated-schemas/reference/errors)

### From Federation 1 to 2

[Upgrade Guide](https://www.apollographql.com/docs/graphos/schema-design/federated-schemas/reference/moving-to-federation-2)[Federation 2 Backwards Compatibility](https://www.apollographql.com/docs/graphos/schema-design/federated-schemas/reference/backward-compatibility)

### Entities

[Introduction](https://www.apollographql.com/docs/graphos/schema-design/federated-schemas/entities/intro)

### Entity Essentials

[Entity Fields](https://www.apollographql.com/docs/graphos/schema-design/federated-schemas/entities/contribute-fields)[Advanced Keys](https://www.apollographql.com/docs/graphos/schema-design/federated-schemas/entities/define-keys)[Entity Interfaces](https://www.apollographql.com/docs/graphos/schema-design/federated-schemas/entities/interfaces)

### Entity Guides

[Entity Best Practices](https://www.apollographql.com/docs/graphos/schema-design/federated-schemas/entities/best-practices)[Migrate Fields](https://www.apollographql.com/docs/graphos/schema-design/federated-schemas/entities/migrate-fields)[Resolve Another Subgraph's Fields](https://www.apollographql.com/docs/graphos/schema-design/federated-schemas/entities/resolve-another-subgraphs-fields)[Enforce Ownership](https://www.apollographql.com/docs/graphos/schema-design/federated-schemas/entities/enforce-ownership)[Use Contexts](https://www.apollographql.com/docs/graphos/schema-design/federated-schemas/entities/use-contexts)

### Schema Design Guides

### Schema Design Principles

[Demand Oriented Schema Design](https://www.apollographql.com/docs/graphos/schema-design/guides/demand-oriented-schema-design)[Naming Conventions](https://www.apollographql.com/docs/graphos/schema-design/guides/naming-conventions)[Namespacing](https://www.apollographql.com/docs/graphos/schema-design/guides/namespacing-by-separation-of-concerns)

### Server-Driven UI

[Basics](https://www.apollographql.com/docs/graphos/schema-design/guides/sdui/basics)[Schema Design](https://www.apollographql.com/docs/graphos/schema-design/guides/sdui/schema-design)[Client Design](https://www.apollographql.com/docs/graphos/schema-design/guides/sdui/client-design)

### Data Handling Techniques

[Handling the N+1 Problem](https://www.apollographql.com/docs/graphos/schema-design/guides/handling-n-plus-one)[Nullability](https://www.apollographql.com/docs/graphos/schema-design/guides/nullability)[Interfaces](https://www.apollographql.com/docs/graphos/schema-design/guides/interfaces)[Response Type Pattern](https://www.apollographql.com/docs/graphos/schema-design/guides/response-type-pattern)[Errors as Data](https://www.apollographql.com/docs/graphos/schema-design/guides/errors-as-data-explained)[Aggregating Data](https://www.apollographql.com/docs/graphos/schema-design/guides/aggregating-data-across-subgraphs)[Graph Identities](https://www.apollographql.com/docs/graphos/schema-design/guides/graph-identities)

### Schema Development and Evolution

[Mocking to Unblock Development](https://www.apollographql.com/docs/graphos/schema-design/guides/mocking)[Deprecations](https://www.apollographql.com/docs/graphos/schema-design/guides/deprecations)[Distributed Orchestration](https://www.apollographql.com/docs/graphos/schema-design/guides/distributed-orchestration)[Migrating from a Monolith](https://www.apollographql.com/docs/graphos/schema-design/guides/from-monolith)[Migrating from Schema Stitching](https://www.apollographql.com/docs/graphos/schema-design/guides/migrating-from-stitching)

## Connectors

[Overview](https://www.apollographql.com/docs/graphos/connectors)[Why use Connectors?](https://www.apollographql.com/docs/graphos/connectors/why-connectors)

### Getting Started

[Quickstart](https://www.apollographql.com/docs/graphos/connectors/getting-started)[API Requirements](https://www.apollographql.com/docs/graphos/connectors/getting-started/requirements)[Version Requirements](https://www.apollographql.com/docs/graphos/connectors/getting-started/version-requirements)

### Connectors Library

[Overview](https://www.apollographql.com/docs/graphos/connectors/library)

### Prebuilt Connectors

[Anthropic](https://www.apollographql.com/docs/graphos/connectors/library/anthropic)[Open AI](https://www.apollographql.com/docs/graphos/connectors/library/openai)[AWS DynamoDB](https://www.apollographql.com/docs/graphos/connectors/library/aws-dynamodb)[AWS Lambda](https://www.apollographql.com/docs/graphos/connectors/library/aws-lambda)[Strapi](https://www.apollographql.com/docs/graphos/connectors/library/strapi)[Stripe](https://www.apollographql.com/docs/graphos/connectors/library/stripe)[OData](https://www.apollographql.com/docs/graphos/connectors/library/odata)

### Development and Tooling

[Overview](https://www.apollographql.com/docs/graphos/connectors/tooling)[IDE Extensions](https://www.apollographql.com/docs/graphos/connectors/tooling/ide-extensions)[Using Rover](https://www.apollographql.com/docs/graphos/connectors/tooling/rover)[CLI Tools](https://www.apollographql.com/docs/graphos/connectors/tooling/cli-tools)[Mapping Playground](https://www.apollographql.com/docs/graphos/connectors/tooling/mapping-playground)

### Making Requests

[Overview](https://www.apollographql.com/docs/graphos/connectors/requests)[Request URLs](https://www.apollographql.com/docs/graphos/connectors/requests/url)[Request Headers](https://www.apollographql.com/docs/graphos/connectors/requests/headers)[Request Bodies](https://www.apollographql.com/docs/graphos/connectors/requests/body)[Batch Requests](https://www.apollographql.com/docs/graphos/connectors/requests/batching)[gRPC over JSON](https://www.apollographql.com/docs/graphos/connectors/requests/grpc-json-bridge)

### Handling Responses

[Overview](https://www.apollographql.com/docs/graphos/connectors/responses)[Mapping Response Fields](https://www.apollographql.com/docs/graphos/connectors/responses/fields)[Error Handling](https://www.apollographql.com/docs/graphos/connectors/responses/error-handling)

### Working with Entities

[Overview](https://www.apollographql.com/docs/graphos/connectors/entities)[Common Patterns](https://www.apollographql.com/docs/graphos/connectors/entities/patterns)[Working Across Subgraphs](https://www.apollographql.com/docs/graphos/connectors/entities/across-subgraphs)

### Mapping Language

[Overview](https://www.apollographql.com/docs/graphos/connectors/mapping)[Handling Arrays](https://www.apollographql.com/docs/graphos/connectors/mapping/arrays)[Mapping Enums](https://www.apollographql.com/docs/graphos/connectors/mapping/enums)[Using Literal Values](https://www.apollographql.com/docs/graphos/connectors/mapping/literals)[Variable Reference](https://www.apollographql.com/docs/graphos/connectors/mapping/variables)[Method Reference](https://www.apollographql.com/docs/graphos/connectors/mapping/methods)

### Deployment

[Overview](https://www.apollographql.com/docs/graphos/connectors/deployment)[Configuration](https://www.apollographql.com/docs/graphos/connectors/deployment/configuration)

### Deployment Configurations

[Overriding Base URLs](https://www.apollographql.com/docs/graphos/connectors/deployment/overriding-base-urls)[Overriding Headers](https://www.apollographql.com/docs/graphos/connectors/deployment/overriding-headers)

### Security Configurations

[Overview](https://www.apollographql.com/docs/graphos/connectors/security)[Authentication](https://www.apollographql.com/docs/graphos/connectors/security/auth)[Request Limits](https://www.apollographql.com/docs/graphos/connectors/security/request-limits)[TLS](https://www.apollographql.com/docs/graphos/connectors/security/tls)

### Performance Configurations

[Overview](https://www.apollographql.com/docs/graphos/connectors/performance)[Traffic Shaping](https://www.apollographql.com/docs/graphos/connectors/performance/traffic-shaping)

### Observability

[Overview](https://www.apollographql.com/docs/graphos/connectors/observability)[Telemetry Configurations](https://www.apollographql.com/docs/graphos/connectors/observability/telemetry)

### Testing

[Testing Framework](https://www.apollographql.com/docs/graphos/connectors/testing)

### Connectors Reference

[Changelog](https://www.apollographql.com/docs/graphos/connectors/reference/changelog)[Directives](https://www.apollographql.com/docs/graphos/connectors/reference/directives)[Limitations](https://www.apollographql.com/docs/graphos/connectors/reference/limitations)

[Troubleshooting](https://www.apollographql.com/docs/graphos/connectors/troubleshooting)

## GraphOS Platform

[Overview](https://www.apollographql.com/docs/graphos/platform)[Apollo Sandbox](https://www.apollographql.com/docs/graphos/platform/sandbox)

### Schema Management

[Overview](https://www.apollographql.com/docs/graphos/platform/schema-management)

### Schema Delivery

### Publishing

[Overview](https://www.apollographql.com/docs/graphos/platform/schema-management/delivery/publishing)[Publish with Rover](https://www.apollographql.com/docs/graphos/platform/schema-management/delivery/publishing/rover)[Publish with the Platform API](https://www.apollographql.com/docs/graphos/platform/schema-management/delivery/publishing/platform-api)[Guide: Publish with GitHub Actions](https://www.apollographql.com/docs/graphos/platform/schema-management/delivery/publishing/guide-github)

[Launches](https://www.apollographql.com/docs/graphos/platform/schema-management/delivery/launch)[Graph Artifacts](https://www.apollographql.com/docs/graphos/platform/schema-management/delivery/graph-artifacts)

### Contracts

[Overview](https://www.apollographql.com/docs/graphos/platform/schema-management/delivery/contracts/overview)[Create](https://www.apollographql.com/docs/graphos/platform/schema-management/delivery/contracts/create)[Usage Patterns](https://www.apollographql.com/docs/graphos/platform/schema-management/delivery/contracts/usage-patterns)[Reference](https://www.apollographql.com/docs/graphos/platform/schema-management/delivery/contracts/reference)

### Schema Checks

[Overview](https://www.apollographql.com/docs/graphos/platform/schema-management/checks)[Run Checks](https://www.apollographql.com/docs/graphos/platform/schema-management/checks/run)[Custom Checks](https://www.apollographql.com/docs/graphos/platform/schema-management/checks/custom)[Checks Configuration](https://www.apollographql.com/docs/graphos/platform/schema-management/checks/configure)[GitHub Integration](https://www.apollographql.com/docs/graphos/platform/schema-management/checks/github-integration)[Checks Reference](https://www.apollographql.com/docs/graphos/platform/schema-management/checks/reference)

### Schema Linting

[Overview](https://www.apollographql.com/docs/graphos/platform/schema-management/linting)[Linter Rules](https://www.apollographql.com/docs/graphos/platform/schema-management/linting/rules)

### Schema Proposals

[Overview](https://www.apollographql.com/docs/graphos/platform/schema-management/proposals)[Configure](https://www.apollographql.com/docs/graphos/platform/schema-management/proposals/configure)[Create](https://www.apollographql.com/docs/graphos/platform/schema-management/proposals/create)[Review](https://www.apollographql.com/docs/graphos/platform/schema-management/proposals/review)[Implement](https://www.apollographql.com/docs/graphos/platform/schema-management/proposals/implement)

### Explorer IDE

[Overview](https://www.apollographql.com/docs/graphos/platform/explorer)[Connect and Authenticate](https://www.apollographql.com/docs/graphos/platform/explorer/connect)[Operation Collections](https://www.apollographql.com/docs/graphos/platform/explorer/operation-collections)[Subscription Support](https://www.apollographql.com/docs/graphos/platform/explorer/subscription-support)[Embed](https://www.apollographql.com/docs/graphos/platform/explorer/embed)[Scripting](https://www.apollographql.com/docs/graphos/platform/explorer/scripting)[Additional Features](https://www.apollographql.com/docs/graphos/platform/explorer/additional-features)

### Graph Security

[Overview](https://www.apollographql.com/docs/graphos/platform/security/overview)[Persisted Queries](https://www.apollographql.com/docs/graphos/platform/security/persisted-queries)

### Metrics and Insights

[Overview](https://www.apollographql.com/docs/graphos/platform/insights)

### Metrics Collection and Forwarding

[Sending Metrics to GraphOS](https://www.apollographql.com/docs/graphos/platform/insights/sending-operation-metrics)[Operation Signatures](https://www.apollographql.com/docs/graphos/platform/insights/operation-signatures)[Datadog Forwarding](https://www.apollographql.com/docs/graphos/platform/insights/datadog-forwarding)

### Insights and Analysis

[Operation Metrics](https://www.apollographql.com/docs/graphos/platform/insights/operation-metrics)[Field Usage](https://www.apollographql.com/docs/graphos/platform/insights/field-usage)[Error Diagnostics](https://www.apollographql.com/docs/graphos/platform/insights/errors)[Subgraph Metrics](https://www.apollographql.com/docs/graphos/platform/insights/subgraphs)[Segmenting by Client](https://www.apollographql.com/docs/graphos/platform/insights/client-segmentation)

### Notifications and Alerts

[Overview](https://www.apollographql.com/docs/graphos/platform/insights/notifications)[Daily Reports](https://www.apollographql.com/docs/graphos/platform/insights/notifications/daily-reports)[Schema Changes](https://www.apollographql.com/docs/graphos/platform/insights/notifications/schema-changes)[Schema Proposals](https://www.apollographql.com/docs/graphos/platform/insights/notifications/schema-proposals)[Performance Alerts](https://www.apollographql.com/docs/graphos/platform/insights/notifications/performance-alerts)[Build Status](https://www.apollographql.com/docs/graphos/platform/insights/notifications/build-status)

### Access Management

[Organizations](https://www.apollographql.com/docs/graphos/platform/access-management/org)[API Keys](https://www.apollographql.com/docs/graphos/platform/access-management/api-keys)[Members, Roles, and Permissions](https://www.apollographql.com/docs/graphos/platform/access-management/member-roles)[Audit Logs](https://www.apollographql.com/docs/graphos/platform/access-management/audit-log)

### SSO

[Overview](https://www.apollographql.com/docs/graphos/platform/access-management/sso/overview)[Multi-Organization](https://www.apollographql.com/docs/graphos/platform/access-management/sso/multi-organization)

### SAML

[Okta](https://www.apollographql.com/docs/graphos/platform/access-management/sso/saml-okta)[Microsoft Entra ID](https://www.apollographql.com/docs/graphos/platform/access-management/sso/saml-microsoft-entra-id)[Generic SAML Setup](https://www.apollographql.com/docs/graphos/platform/access-management/sso/saml-integration-guide)

### OIDC

[Okta](https://www.apollographql.com/docs/graphos/platform/access-management/sso/oidc-okta)[Microsoft Entra ID](https://www.apollographql.com/docs/graphos/platform/access-management/sso/oidc-microsoft-entra-id)[Generic OIDC Setup](https://www.apollographql.com/docs/graphos/platform/access-management/sso/oidc-integration-guide)

### SCIM

[Overview](https://www.apollographql.com/docs/graphos/platform/access-management/scim)[Okta](https://www.apollographql.com/docs/graphos/platform/access-management/scim/okta)[Microsoft Entra ID](https://www.apollographql.com/docs/graphos/platform/access-management/scim/microsoft-entra-id)

### Graph Management

[Using Variants](https://www.apollographql.com/docs/graphos/platform/graph-management/variants)[Adding Subgraphs](https://www.apollographql.com/docs/graphos/platform/graph-management/add-subgraphs)[Managing Subgraphs](https://www.apollographql.com/docs/graphos/platform/graph-management/manage-subgraphs)[Updating Graph Components](https://www.apollographql.com/docs/graphos/platform/graph-management/updates)[Transferring Graphs](https://www.apollographql.com/docs/graphos/platform/graph-management/transfers)

### Production Readiness

[Production Readiness Checklist](https://www.apollographql.com/docs/graphos/platform/production-readiness/checklist)

### Testing and Load Management

[Overload Protection](https://www.apollographql.com/docs/graphos/platform/production-readiness/overload-protection)[Load Testing](https://www.apollographql.com/docs/graphos/platform/production-readiness/load-testing)[Testing with Federation](https://www.apollographql.com/docs/graphos/platform/production-readiness/testing-with-apollo-federation)

### Environment and Deployment

[Environment Best Practices](https://www.apollographql.com/docs/graphos/platform/production-readiness/environment-best-practices)[Schema Change Management](https://www.apollographql.com/docs/graphos/platform/production-readiness/change-management)[Updating Client Schema](https://www.apollographql.com/docs/graphos/platform/production-readiness/updating-client-schema)[Deployment Best Practices](https://www.apollographql.com/docs/graphos/platform/production-readiness/deployment-best-practices)

[Platform Limits](https://www.apollographql.com/docs/graphos/platform/platform-limits)[GraphOS Platform API](https://www.apollographql.com/docs/graphos/platform/platform-api)[GraphOS MCP Tools](https://www.apollographql.com/docs/graphos/platform/graphos-mcp-tools)

## Routing

Apollo Router - v2 (latest)

[Overview](https://www.apollographql.com/docs/graphos/routing)[Get Started](https://www.apollographql.com/docs/graphos/routing/get-started)[Request Lifecycle](https://www.apollographql.com/docs/graphos/routing/request-lifecycle)

### Configuration

[Overview](https://www.apollographql.com/docs/graphos/routing/configuration/overview)[Environment Variable Reference](https://www.apollographql.com/docs/graphos/routing/configuration/envvars)[CLI Reference](https://www.apollographql.com/docs/graphos/routing/configuration/cli)[YAML Reference](https://www.apollographql.com/docs/graphos/routing/configuration/yaml)

### Features

### Security

[Overview](https://www.apollographql.com/docs/graphos/routing/security)[Persisted Queries](https://www.apollographql.com/docs/graphos/routing/security/persisted-queries)[Authorization](https://www.apollographql.com/docs/graphos/routing/security/authorization)

### Authentication

[JWT Authentication](https://www.apollographql.com/docs/graphos/routing/security/jwt)[Router Authentication](https://www.apollographql.com/docs/graphos/routing/security/router-authentication)[Subgraph Authentication](https://www.apollographql.com/docs/graphos/routing/security/subgraph-authentication)

[CORS](https://www.apollographql.com/docs/graphos/routing/security/cors)[CSRF Prevention](https://www.apollographql.com/docs/graphos/routing/security/csrf)[TLS](https://www.apollographql.com/docs/graphos/routing/security/tls)[Request Limits](https://www.apollographql.com/docs/graphos/routing/security/request-limits)[Demand Control](https://www.apollographql.com/docs/graphos/routing/security/demand-control)

### Observability

### Studio Insights

[Overview](https://www.apollographql.com/docs/graphos/routing/observability/graphos)[Operation Metrics Reporting](https://www.apollographql.com/docs/graphos/routing/observability/graphos/graphos-reporting)[Federated Trace Data](https://www.apollographql.com/docs/graphos/routing/observability/graphos/federated-trace-data)

### Router Telemetry (OTEL)

[Overview](https://www.apollographql.com/docs/graphos/routing/observability/router-telemetry-otel)

### Telemetry Data

### Metrics

[Instruments](https://www.apollographql.com/docs/graphos/routing/observability/router-telemetry-otel/enabling-telemetry/instruments)[Standard Instruments](https://www.apollographql.com/docs/graphos/routing/observability/router-telemetry-otel/enabling-telemetry/standard-instruments)

[Events](https://www.apollographql.com/docs/graphos/routing/observability/router-telemetry-otel/enabling-telemetry/events)

### Traces

[Spans](https://www.apollographql.com/docs/graphos/routing/observability/router-telemetry-otel/enabling-telemetry/spans)[Standard Attributes](https://www.apollographql.com/docs/graphos/routing/observability/router-telemetry-otel/enabling-telemetry/standard-attributes)

[Conditions](https://www.apollographql.com/docs/graphos/routing/observability/router-telemetry-otel/enabling-telemetry/conditions)[Selectors](https://www.apollographql.com/docs/graphos/routing/observability/router-telemetry-otel/enabling-telemetry/selectors)

### Usage Guides

### Subgraph Observability

[Subgraph Error Inclusion](https://www.apollographql.com/docs/graphos/routing/observability/router-telemetry-otel/enabling-telemetry/usage-guides/subgraph-error-inclusion)[Debugging Subgraph Requests](https://www.apollographql.com/docs/graphos/routing/observability/router-telemetry-otel/enabling-telemetry/usage-guides/debugging-subgraph-requests)[Instrumenting Subgraphs](https://www.apollographql.com/docs/graphos/routing/observability/router-telemetry-otel/enabling-telemetry/usage-guides/subgraph-instrumentation)

### Client Observability

[Debugging Client Requests](https://www.apollographql.com/docs/graphos/routing/observability/router-telemetry-otel/enabling-telemetry/usage-guides/debugging-client-requests)[Client ID Enforcement](https://www.apollographql.com/docs/graphos/routing/observability/router-telemetry-otel/enabling-telemetry/usage-guides/client-id-enforcement)

### Telemetry Exporters

### Metrics Exporters

[Overview](https://www.apollographql.com/docs/graphos/routing/observability/router-telemetry-otel/telemetry-pipelines/metrics-exporters/overview)[OTLP](https://www.apollographql.com/docs/graphos/routing/observability/router-telemetry-otel/telemetry-pipelines/metrics-exporters/otlp)

### Log Exporters

[Overview](https://www.apollographql.com/docs/graphos/routing/observability/router-telemetry-otel/telemetry-pipelines/log-exporters/overview)[Stdout](https://www.apollographql.com/docs/graphos/routing/observability/router-telemetry-otel/telemetry-pipelines/log-exporters/stdout)

### Trace Exporters

[Overview](https://www.apollographql.com/docs/graphos/routing/observability/router-telemetry-otel/telemetry-pipelines/trace-exporters/overview)[OTLP](https://www.apollographql.com/docs/graphos/routing/observability/router-telemetry-otel/telemetry-pipelines/trace-exporters/otlp)

### APM Guides

### Datadog

[Overview](https://www.apollographql.com/docs/graphos/routing/observability/router-telemetry-otel/apm-guides/datadog)

### Connecting to Datadog

[Overview](https://www.apollographql.com/docs/graphos/routing/observability/router-telemetry-otel/apm-guides/datadog/connecting-to-datadog)[OpenTelemetry Collector](https://www.apollographql.com/docs/graphos/routing/observability/router-telemetry-otel/apm-guides/datadog/connecting-to-datadog/otel-collector)

### Datadog Agent

[Metrics](https://www.apollographql.com/docs/graphos/routing/observability/router-telemetry-otel/apm-guides/datadog/connecting-to-datadog/datadog-agent/datadog-agent-metrics)[Traces](https://www.apollographql.com/docs/graphos/routing/observability/router-telemetry-otel/apm-guides/datadog/connecting-to-datadog/datadog-agent/datadog-agent-traces)

[Router Instrumentation](https://www.apollographql.com/docs/graphos/routing/observability/router-telemetry-otel/apm-guides/datadog/router-instrumentation)[Dashboard Template](https://www.apollographql.com/docs/graphos/routing/observability/router-telemetry-otel/apm-guides/datadog/observing-and-monitoring/dashboard-template)

### New Relic

[Metrics](https://www.apollographql.com/docs/graphos/routing/observability/router-telemetry-otel/apm-guides/new-relic/new-relic-otlp-metrics)[Traces](https://www.apollographql.com/docs/graphos/routing/observability/router-telemetry-otel/apm-guides/new-relic/new-relic-otlp-traces)

### Prometheus

[Metrics](https://www.apollographql.com/docs/graphos/routing/observability/router-telemetry-otel/apm-guides/prometheus/prometheus-metrics)[Trace Metrics](https://www.apollographql.com/docs/graphos/routing/observability/router-telemetry-otel/apm-guides/prometheus/otel-traces-to-prometheus)

### Zipkin

[Traces](https://www.apollographql.com/docs/graphos/routing/observability/router-telemetry-otel/apm-guides/zipkin/zipkin-traces)

### Jaeger

[Traces](https://www.apollographql.com/docs/graphos/routing/observability/router-telemetry-otel/apm-guides/jaeger/jaeger-traces)

### Dynatrace

[Metrics](https://www.apollographql.com/docs/graphos/routing/observability/router-telemetry-otel/apm-guides/dynatrace/dynatrace-metrics)[Traces](https://www.apollographql.com/docs/graphos/routing/observability/router-telemetry-otel/apm-guides/dynatrace/dynatrace-traces)

### Performance and Scaling

[Overview](https://www.apollographql.com/docs/graphos/routing/performance)

### Response Caching

[Overview](https://www.apollographql.com/docs/graphos/routing/performance/caching/response-caching/overview)[Quickstart](https://www.apollographql.com/docs/graphos/routing/performance/caching/response-caching/quickstart)[Invalidation](https://www.apollographql.com/docs/graphos/routing/performance/caching/response-caching/invalidation)[Customization](https://www.apollographql.com/docs/graphos/routing/performance/caching/response-caching/customization)[Observability](https://www.apollographql.com/docs/graphos/routing/performance/caching/response-caching/observability)[FAQ](https://www.apollographql.com/docs/graphos/routing/performance/caching/response-caching/faq)

[Traffic Shaping](https://www.apollographql.com/docs/graphos/routing/performance/traffic-shaping)[Query Batching](https://www.apollographql.com/docs/graphos/routing/performance/query-batching)

### Client Features

[APQ](https://www.apollographql.com/docs/graphos/routing/operations/apq)[HTTP Header Propagation](https://www.apollographql.com/docs/graphos/routing/header-propagation)[@defer](https://www.apollographql.com/docs/graphos/routing/operations/defer)

### GraphQL Subscriptions

[Overview](https://www.apollographql.com/docs/graphos/routing/operations/subscriptions/overview)[Configuration](https://www.apollographql.com/docs/graphos/routing/operations/subscriptions/configuration)[Callback Protocol](https://www.apollographql.com/docs/graphos/routing/operations/subscriptions/callback-protocol)[Multipart Protocol](https://www.apollographql.com/docs/graphos/routing/operations/subscriptions/multipart-protocol)[Enable with API Gateway](https://www.apollographql.com/docs/graphos/routing/operations/subscriptions/api-gateway)

[File Upload](https://www.apollographql.com/docs/graphos/routing/operations/file-upload)

### Query Planning

[Native Query Planner](https://www.apollographql.com/docs/graphos/routing/query-planning/native-query-planner)[Best Practices](https://www.apollographql.com/docs/graphos/routing/query-planning/query-planning-best-practices)[Caching](https://www.apollographql.com/docs/graphos/routing/query-planning/caching)

### Customization

[Overview](https://www.apollographql.com/docs/graphos/routing/customization/overview)

### Coprocessors

[Coprocessor Configuration](https://www.apollographql.com/docs/graphos/routing/customization/coprocessor)[Coprocessor Reference](https://www.apollographql.com/docs/graphos/routing/customization/coprocessor/reference)

### Rhai Scripts

[Rhai Configuration](https://www.apollographql.com/docs/graphos/routing/customization/rhai)[Rhai API Reference](https://www.apollographql.com/docs/graphos/routing/customization/rhai/reference)

### Custom Builds

[Building a Binary](https://www.apollographql.com/docs/graphos/routing/customization/custom-binary)[Rust Plugins](https://www.apollographql.com/docs/graphos/routing/customization/native-plugins)

### Deployment

[Overview](https://www.apollographql.com/docs/graphos/routing/self-hosted)

### Docker

[Docker with the Apollo Runtime Container](https://www.apollographql.com/docs/graphos/routing/self-hosted/containerization/docker)[Docker with Apollo Router](https://www.apollographql.com/docs/graphos/routing/self-hosted/containerization/docker-router-only)

### Kubernetes

[Quickstart](https://www.apollographql.com/docs/graphos/routing/self-hosted/containerization/kubernetes/quickstart)[Deploying with Extensibility](https://www.apollographql.com/docs/graphos/routing/self-hosted/containerization/kubernetes/extensibility)[Enabling Metrics](https://www.apollographql.com/docs/graphos/routing/self-hosted/containerization/kubernetes/metrics)[Other Considerations](https://www.apollographql.com/docs/graphos/routing/self-hosted/containerization/kubernetes/other-considerations)

### AWS

[AWS ECS](https://www.apollographql.com/docs/graphos/routing/self-hosted/containerization/aws)

### Azure

[Azure Container Apps](https://www.apollographql.com/docs/graphos/routing/self-hosted/containerization/azure)

### GCP

[Google Cloud Run](https://www.apollographql.com/docs/graphos/routing/self-hosted/containerization/gcp)

### Managed Hosting

[Railway](https://www.apollographql.com/docs/graphos/routing/self-hosted/managed-hosting/railway)[Render](https://www.apollographql.com/docs/graphos/routing/self-hosted/managed-hosting/render)

### Apollo Cloud Routing

[Overview](https://www.apollographql.com/docs/graphos/routing/cloud)[Configuration](https://www.apollographql.com/docs/graphos/routing/cloud/configuration)[Secure Subgraphs](https://www.apollographql.com/docs/graphos/routing/cloud/secure-subgraphs)[Subscriptions](https://www.apollographql.com/docs/graphos/routing/cloud/subscriptions)[Serverless](https://www.apollographql.com/docs/graphos/routing/cloud/serverless)

### Dedicated

[Overview](https://www.apollographql.com/docs/graphos/routing/cloud/dedicated)[Quickstart](https://www.apollographql.com/docs/graphos/routing/cloud/dedicated-quickstart)[Custom Domains](https://www.apollographql.com/docs/graphos/routing/cloud/custom-domains)[Throughput Guide](https://www.apollographql.com/docs/graphos/routing/cloud/throughput-guide)[Migrate to Dedicated](https://www.apollographql.com/docs/graphos/routing/cloud/migrate-to-dedicated)

### AWS Lattice

[Lattice Configuration](https://www.apollographql.com/docs/graphos/routing/cloud/lattice-configuration)[Lattice Management](https://www.apollographql.com/docs/graphos/routing/cloud/lattice-management)[Lattice Troubleshooting](https://www.apollographql.com/docs/graphos/routing/cloud/lattice-troubleshooting)

### Tools

[Router Resource Estimator](https://www.apollographql.com/docs/graphos/routing/self-hosted/resource-estimator)[Health Checks](https://www.apollographql.com/docs/graphos/routing/self-hosted/health-checks)[Resource Management](https://www.apollographql.com/docs/graphos/routing/self-hosted/resource-management)

### Releases

[Changelogs](https://www.apollographql.com/docs/graphos/routing/changelog)[What's New in Router v2](https://www.apollographql.com/docs/graphos/routing/about-v2)[Upgrade from Router v1](https://www.apollographql.com/docs/graphos/routing/upgrade/from-router-v1)[Migrate from Gateway](https://www.apollographql.com/docs/graphos/routing/migration/from-gateway)[API Gateway Comparison](https://www.apollographql.com/docs/graphos/routing/router-api-gateway-comparison)

### GraphOS Integration

[GraphOS Plan License](https://www.apollographql.com/docs/graphos/routing/license)[GraphOS Plan Features](https://www.apollographql.com/docs/graphos/routing/graphos-features)[Apollo Uplink](https://www.apollographql.com/docs/graphos/routing/uplink)

### Reference

[Federation Version Support](https://www.apollographql.com/docs/graphos/routing/federation-version-support)[Errors](https://www.apollographql.com/docs/graphos/routing/errors)

## Resources

[Overview](https://www.apollographql.com/docs/graphos/resources)[Changelogs](https://www.apollographql.com/docs/graphos/resources/changelog)[Glossary](https://www.apollographql.com/docs/graphos/resources/glossary)[Examples](https://www.apollographql.com/docs/graphos/resources/solutions)

### Release Policies

[Apollo Feature Launch Stages](https://www.apollographql.com/docs/graphos/resources/feature-launch-stages)[GraphOS Router Release Lifecycle](https://www.apollographql.com/docs/graphos/resources/router-release-lifecycle)[Apollo Client Library Release Lifecycle](https://www.apollographql.com/docs/graphos/resources/client-library-release-lifecycle)

### Architecture

[Reference Architecture](https://www.apollographql.com/docs/graphos/resources/architecture)

### Supergraph Architecture Framework

[Overview](https://www.apollographql.com/docs/graphos/resources/saf)[Operational Excellence](https://www.apollographql.com/docs/graphos/resources/saf/operational-excellence)[Security](https://www.apollographql.com/docs/graphos/resources/saf/security)[Reliability](https://www.apollographql.com/docs/graphos/resources/saf/reliability)[Performance](https://www.apollographql.com/docs/graphos/resources/saf/performance)[Developer Experience](https://www.apollographql.com/docs/graphos/resources/saf/developer-experience)

### GraphQL Adoption Guides

[GraphQL Adoption Patterns](https://www.apollographql.com/docs/graphos/resources/guides/graphql-adoption-patterns)[Using GraphQL for Abstraction](https://www.apollographql.com/docs/graphos/resources/guides/using-graphql-for-abstraction)[Supergraph Stewardship](https://www.apollographql.com/docs/graphos/resources/guides/supergraph-stewardship)

## Rover CLI

[Overview](https://www.apollographql.com/docs/rover)[Install](https://www.apollographql.com/docs/rover/getting-started)[Configure](https://www.apollographql.com/docs/rover/configuring)[Proxy Configuration](https://www.apollographql.com/docs/rover/proxy)[CI/CD](https://www.apollographql.com/docs/rover/ci-cd)[Conventions](https://www.apollographql.com/docs/rover/conventions)[Privacy and Data Collection](https://www.apollographql.com/docs/rover/privacy)[Contributing](https://www.apollographql.com/docs/rover/contributing)[Error Codes](https://www.apollographql.com/docs/rover/errors)

### Commands

[api-key](https://www.apollographql.com/docs/rover/commands/api-key)[cloud](https://www.apollographql.com/docs/rover/commands/cloud)[config](https://www.apollographql.com/docs/rover/commands/config)[connector](https://www.apollographql.com/docs/rover/commands/connectors)[contract](https://www.apollographql.com/docs/rover/commands/contracts)[dev](https://www.apollographql.com/docs/rover/commands/dev)[explain](https://www.apollographql.com/docs/rover/commands/explain)[graph](https://www.apollographql.com/docs/rover/commands/graphs)[init](https://www.apollographql.com/docs/rover/commands/init)[license](https://www.apollographql.com/docs/rover/commands/license)[persisted-queries](https://www.apollographql.com/docs/rover/commands/persisted-queries)[readme](https://www.apollographql.com/docs/rover/commands/readmes)[subgraph](https://www.apollographql.com/docs/rover/commands/subgraphs)[supergraph](https://www.apollographql.com/docs/rover/commands/supergraphs)[template](https://www.apollographql.com/docs/rover/commands/template)

### The Apollo CLI (deprecated)

[Installation](https://www.apollographql.com/docs/rover/apollo-cli)[Validating Client Operations](https://www.apollographql.com/docs/rover/validating-client-operations)[Moving to Rover](https://www.apollographql.com/docs/rover/migration)

## IDE Support

### IDE Support

[Overview](https://www.apollographql.com/docs/ide-support)[Visual Studio Code](https://www.apollographql.com/docs/ide-support/vs-code)[JetBrains IDEs](https://www.apollographql.com/docs/ide-support/jetbrains)[Vim/NeoVim](https://www.apollographql.com/docs/ide-support/vim)

## Apollo Client (Web)

Apollo Client (Web) - v4 (latest)

[Introduction](https://www.apollographql.com/docs/react)[Why Apollo Client?](https://www.apollographql.com/docs/react/why-apollo)[Get started](https://www.apollographql.com/docs/react/get-started)

### Core concepts

[Queries](https://www.apollographql.com/docs/react/data/queries)[Suspense](https://www.apollographql.com/docs/react/data/suspense)[Fragments](https://www.apollographql.com/docs/react/data/fragments)[Mutations](https://www.apollographql.com/docs/react/data/mutations)[TypeScript](https://www.apollographql.com/docs/react/data/typescript)[Refetching](https://www.apollographql.com/docs/react/data/refetching)[Subscriptions](https://www.apollographql.com/docs/react/data/subscriptions)[Directives](https://www.apollographql.com/docs/react/data/directives)[Error handling](https://www.apollographql.com/docs/react/data/error-handling)[Persisted queries](https://www.apollographql.com/docs/react/data/persisted-queries)[Document transforms](https://www.apollographql.com/docs/react/data/document-transforms)[Deferring response data](https://www.apollographql.com/docs/react/data/defer)[Best practices](https://www.apollographql.com/docs/react/data/operation-best-practices)

### Caching

[Overview](https://www.apollographql.com/docs/react/caching/overview)[Configuration](https://www.apollographql.com/docs/react/caching/cache-configuration)[Reading and writing](https://www.apollographql.com/docs/react/caching/cache-interaction)[Garbage collection and eviction](https://www.apollographql.com/docs/react/caching/garbage-collection)[Customizing field behavior](https://www.apollographql.com/docs/react/caching/cache-field-behavior)[Memory Management](https://www.apollographql.com/docs/react/caching/memory-management)[Advanced topics](https://www.apollographql.com/docs/react/caching/advanced-topics)

### Pagination

[Overview](https://www.apollographql.com/docs/react/pagination/overview)[Core API](https://www.apollographql.com/docs/react/pagination/core-api)[Offset-based](https://www.apollographql.com/docs/react/pagination/offset-based)[Cursor-based](https://www.apollographql.com/docs/react/pagination/cursor-based)[keyArgs](https://www.apollographql.com/docs/react/pagination/key-args)

### Local State

[Overview](https://www.apollographql.com/docs/react/local-state/local-state-management)[Local-only fields](https://www.apollographql.com/docs/react/local-state/managing-state-with-field-policies)[Reactive variables](https://www.apollographql.com/docs/react/local-state/reactive-variables)[Local resolvers](https://www.apollographql.com/docs/react/local-state/local-resolvers)

### Development & Testing

[Developer tools](https://www.apollographql.com/docs/react/development-testing/developer-tooling)[GraphQL Codegen](https://www.apollographql.com/docs/react/development-testing/graphql-codegen)[Testing React components](https://www.apollographql.com/docs/react/development-testing/testing)[Schema-driven testing](https://www.apollographql.com/docs/react/development-testing/schema-driven-testing)[Mocking schema capabilities](https://www.apollographql.com/docs/react/development-testing/client-schema-mocking)[Reducing bundle size](https://www.apollographql.com/docs/react/development-testing/reducing-bundle-size)

### Performance

[Improving performance](https://www.apollographql.com/docs/react/performance/performance)[Optimistic mutation results](https://www.apollographql.com/docs/react/performance/optimistic-ui)[Server-side rendering](https://www.apollographql.com/docs/react/performance/server-side-rendering)[Compiling queries with Babel](https://www.apollographql.com/docs/react/performance/babel)

### Integrations

[Using Apollo Client with your view layer](https://www.apollographql.com/docs/react/integrations/integrations)[Integrating with React Native](https://www.apollographql.com/docs/react/integrations/react-native)[Loading queries with Webpack](https://www.apollographql.com/docs/react/integrations/webpack)

### Networking

[Basic HTTP networking](https://www.apollographql.com/docs/react/networking/basic-http-networking)[Advanced HTTP networking](https://www.apollographql.com/docs/react/networking/advanced-http-networking)[Authentication](https://www.apollographql.com/docs/react/networking/authentication)

### API Reference

### Core

[ApolloClient](https://www.apollographql.com/docs/react/api/core/ApolloClient)[InMemoryCache](https://www.apollographql.com/docs/react/api/cache/InMemoryCache)[ObservableQuery](https://www.apollographql.com/docs/react/api/core/ObservableQuery)

### Errors

[CombinedGraphQLErrors](https://www.apollographql.com/docs/react/api/errors/CombinedGraphQLErrors)[CombinedProtocolErrors](https://www.apollographql.com/docs/react/api/errors/CombinedProtocolErrors)[LinkError](https://www.apollographql.com/docs/react/api/errors/LinkError)[LocalStateError](https://www.apollographql.com/docs/react/api/errors/LocalStateError)[ServerError](https://www.apollographql.com/docs/react/api/errors/ServerError)[ServerParseError](https://www.apollographql.com/docs/react/api/errors/ServerParseError)[UnconventionalError](https://www.apollographql.com/docs/react/api/errors/UnconventionalError)

### React

[ApolloProvider](https://www.apollographql.com/docs/react/api/react/ApolloProvider)[useQuery](https://www.apollographql.com/docs/react/api/react/useQuery)[useLazyQuery](https://www.apollographql.com/docs/react/api/react/useLazyQuery)[useMutation](https://www.apollographql.com/docs/react/api/react/useMutation)[useSubscription](https://www.apollographql.com/docs/react/api/react/useSubscription)[useFragment](https://www.apollographql.com/docs/react/api/react/useFragment)[useApolloClient](https://www.apollographql.com/docs/react/api/react/useApolloClient)[useReactiveVar](https://www.apollographql.com/docs/react/api/react/useReactiveVar)[useSuspenseQuery](https://www.apollographql.com/docs/react/api/react/useSuspenseQuery)[useBackgroundQuery](https://www.apollographql.com/docs/react/api/react/useBackgroundQuery)[useReadQuery](https://www.apollographql.com/docs/react/api/react/useReadQuery)[useLoadableQuery](https://www.apollographql.com/docs/react/api/react/useLoadableQuery)[useQueryRefHandlers](https://www.apollographql.com/docs/react/api/react/useQueryRefHandlers)[skipToken](https://www.apollographql.com/docs/react/api/react/skipToken)[createQueryPreloader](https://www.apollographql.com/docs/react/api/react/preloading)[MockProvider](https://www.apollographql.com/docs/react/api/react/testing)[SSR](https://www.apollographql.com/docs/react/api/react/ssr)

### Apollo Link

[Overview](https://www.apollographql.com/docs/react/api/link/introduction)[ApolloLink](https://www.apollographql.com/docs/react/api/link/apollo-link)[BaseHttpLink](https://www.apollographql.com/docs/react/api/link/apollo-link-base-http)[BaseBatchHttpLink](https://www.apollographql.com/docs/react/api/link/apollo-link-base-batch-http)[BatchHttpLink](https://www.apollographql.com/docs/react/api/link/apollo-link-batch-http)[BatchLink](https://www.apollographql.com/docs/react/api/link/apollo-link-batch)[ClientAwarenessLink](https://www.apollographql.com/docs/react/api/link/apollo-link-client-awareness)[ErrorLink](https://www.apollographql.com/docs/react/api/link/apollo-link-error)[GraphQLWsLink](https://www.apollographql.com/docs/react/api/link/apollo-link-subscriptions)[HttpLink](https://www.apollographql.com/docs/react/api/link/apollo-link-http)[PersistedQueryLink](https://www.apollographql.com/docs/react/api/link/apollo-link-persisted-queries)[RemoveTypenameFromVariablesLink](https://www.apollographql.com/docs/react/api/link/apollo-link-remove-typename)[RetryLink](https://www.apollographql.com/docs/react/api/link/apollo-link-retry)[SchemaLink](https://www.apollographql.com/docs/react/api/link/apollo-link-schema)[SetContextLink](https://www.apollographql.com/docs/react/api/link/apollo-link-context)[WebSocketLink (deprecated)](https://www.apollographql.com/docs/react/api/link/apollo-link-ws)[Community links](https://www.apollographql.com/docs/react/api/link/community-links)

[Changelog](https://github.com/apollographql/apollo-client/blob/main/CHANGELOG.md)[Migrating to Apollo Client 4.0](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration)[Versioning Policy](https://www.apollographql.com/docs/react/versioning-policy)

## Apollo iOS

Apollo iOS - v2 (latest)

[Introduction](https://www.apollographql.com/docs/ios)[Get Started](https://www.apollographql.com/docs/ios/get-started)

### Project Configuration

[Introduction](https://www.apollographql.com/docs/ios/project-configuration/intro)[1\. Project Modularization](https://www.apollographql.com/docs/ios/project-configuration/modularization)[2\. Schema Types](https://www.apollographql.com/docs/ios/project-configuration/schema-types)[3\. Operation Models](https://www.apollographql.com/docs/ios/project-configuration/operation-models)[SDK components](https://www.apollographql.com/docs/ios/project-configuration/sdk-components)

### Migration Guides

[v2.0](https://www.apollographql.com/docs/ios/migrations/2.0)

### Tutorial

[Code Generation](https://www.apollographql.com/docs/ios/tutorial/codegen-getting-started)

### Build a project with Apollo

[Introduction](https://www.apollographql.com/docs/ios/tutorial/tutorial-introduction)[1\. Configure your project](https://www.apollographql.com/docs/ios/tutorial/tutorial-configure-project)[2\. Add the GraphQL schema](https://www.apollographql.com/docs/ios/tutorial/tutorial-add-graphql-schema)[3\. Write your first query](https://www.apollographql.com/docs/ios/tutorial/tutorial-write-your-first-query)[4\. Running code generation](https://www.apollographql.com/docs/ios/tutorial/tutorial-running-code-generation)[5\. Execute your first query](https://www.apollographql.com/docs/ios/tutorial/tutorial-execute-first-query)[6\. Connect your queries to your UI](https://www.apollographql.com/docs/ios/tutorial/tutorial-connect-queries-to-ui)[7\. Add more info to the list](https://www.apollographql.com/docs/ios/tutorial/tutorial-add-more-info-to-list)[8\. Paginate results](https://www.apollographql.com/docs/ios/tutorial/tutorial-paginate-results)[9\. Complete the details view](https://www.apollographql.com/docs/ios/tutorial/tutorial-complete-details-view)[10\. Write your first mutation](https://www.apollographql.com/docs/ios/tutorial/tutorial-first-mutation)[11\. Authenticate your operations](https://www.apollographql.com/docs/ios/tutorial/tutorial-authenticate-operations)[12\. Define additional mutations](https://www.apollographql.com/docs/ios/tutorial/tutorial-define-additional-mutations)

[API Reference](https://www.apollographql.com/docs/ios/docc/documentation)

### Code Generation

[Introduction](https://www.apollographql.com/docs/ios/code-generation/introduction)[The Codegen CLI](https://www.apollographql.com/docs/ios/code-generation/codegen-cli)[Configuration](https://www.apollographql.com/docs/ios/code-generation/codegen-configuration)[Downloading a Schema](https://www.apollographql.com/docs/ios/code-generation/downloading-schema)[Running Code Generation in Swift Code](https://www.apollographql.com/docs/ios/code-generation/run-codegen-in-swift-code)[Code Generation Troubleshooting](https://www.apollographql.com/docs/ios/troubleshooting/codegen-troubleshooting)

### Fetching

[Fetching Data](https://www.apollographql.com/docs/ios/fetching/fetching-data)

### Operations

[Queries](https://www.apollographql.com/docs/ios/fetching/queries)[Mutations](https://www.apollographql.com/docs/ios/fetching/mutations)[Subscriptions](https://www.apollographql.com/docs/ios/fetching/subscriptions)[Fragments](https://www.apollographql.com/docs/ios/fetching/fragments)

[Operation Arguments](https://www.apollographql.com/docs/ios/fetching/operation-arguments)[Error Handling](https://www.apollographql.com/docs/ios/fetching/error-handling)[Type Conditions](https://www.apollographql.com/docs/ios/fetching/type-conditions)[Custom Scalars](https://www.apollographql.com/docs/ios/custom-scalars)[Persisted Queries](https://www.apollographql.com/docs/ios/fetching/persisted-queries)[@defer support](https://www.apollographql.com/docs/ios/fetching/defer)

### Caching

[Introduction](https://www.apollographql.com/docs/ios/caching/introduction)[Setup](https://www.apollographql.com/docs/ios/caching/cache-setup)[Direct Cache Access](https://www.apollographql.com/docs/ios/caching/cache-transactions)[Custom Cache Keys](https://www.apollographql.com/docs/ios/caching/cache-key-resolution)[Programmatic Cache Keys](https://www.apollographql.com/docs/ios/caching/programmatic-cache-keys)

### Networking

[Creating a Client](https://www.apollographql.com/docs/ios/networking/client-creation)

### Pagination

[Introduction](https://www.apollographql.com/docs/ios/pagination/introduction)[Using Custom Response Models](https://www.apollographql.com/docs/ios/pagination/custom-types)[Directional Pagination](https://www.apollographql.com/docs/ios/pagination/directional-pagers)[Multi-query Pagination](https://www.apollographql.com/docs/ios/pagination/multi-query)

### Development & Testing

[Test Mocks](https://www.apollographql.com/docs/ios/testing/test-mocks)[Including Apollo as an XCFramework](https://www.apollographql.com/docs/ios/development/using-xcframework)

### Advanced

[File Uploads](https://www.apollographql.com/docs/ios/advanced/file-uploads)[Request Chain Customization](https://www.apollographql.com/docs/ios/advanced/request-chain)[Client Directives](https://www.apollographql.com/docs/ios/client-directives)

## Apollo Kotlin

Apollo Kotlin - v4 (latest)

[Get Started](https://www.apollographql.com/docs/kotlin)[Migrating to v4](https://www.apollographql.com/docs/kotlin/migration/4.0)[Modules](https://www.apollographql.com/docs/kotlin/essentials/modules)[Evolution policy](https://www.apollographql.com/docs/kotlin/essentials/evolution)[Tutorial](https://www.apollographql.com/tutorials/apollo-kotlin-android-part1)[Kdoc](https://apollographql.github.io/apollo-kotlin/kdoc/older/4.2.0/)[Changelog](https://github.com/apollographql/apollo-kotlin/blob/main/CHANGELOG.md)

### Configuration

[Gradle plugin configuration](https://www.apollographql.com/docs/kotlin/advanced/plugin-configuration)[Gradle plugin recipes](https://www.apollographql.com/docs/kotlin/advanced/plugin-recipes)[Multi Modules](https://www.apollographql.com/docs/kotlin/advanced/multi-modules)[File types](https://www.apollographql.com/docs/kotlin/essentials/file-types)[Client Awareness](https://www.apollographql.com/docs/kotlin/advanced/client-awareness)

### Fetching

[Queries](https://www.apollographql.com/docs/kotlin/essentials/queries)[Mutations](https://www.apollographql.com/docs/kotlin/essentials/mutations)[Subscriptions](https://www.apollographql.com/docs/kotlin/essentials/subscriptions)[GraphQL variables](https://www.apollographql.com/docs/kotlin/advanced/operation-variables)[Error handling](https://www.apollographql.com/docs/kotlin/essentials/errors)[Custom scalars](https://www.apollographql.com/docs/kotlin/essentials/custom-scalars)[Fragments](https://www.apollographql.com/docs/kotlin/essentials/fragments)[@defer support](https://www.apollographql.com/docs/kotlin/fetching/defer)[Persisted queries](https://www.apollographql.com/docs/kotlin/advanced/persisted-queries)

### Caching

[Introduction](https://www.apollographql.com/docs/kotlin/caching/introduction)[Normalized caches](https://www.apollographql.com/docs/kotlin/caching/normalized-cache)[Declarative cache IDs](https://www.apollographql.com/docs/kotlin/caching/declarative-ids)[Programmatic cache IDs](https://www.apollographql.com/docs/kotlin/caching/programmatic-ids)[Watching cached data](https://www.apollographql.com/docs/kotlin/caching/query-watchers)[ApolloStore](https://www.apollographql.com/docs/kotlin/caching/store)[HTTP cache](https://www.apollographql.com/docs/kotlin/caching/http-cache)[Troubleshooting](https://www.apollographql.com/docs/kotlin/caching/troubleshooting)

### Networking

[Interceptors](https://www.apollographql.com/docs/kotlin/advanced/interceptors-http)[Custom HTTP clients](https://www.apollographql.com/docs/kotlin/advanced/http-engine)[Using the models without apollo-runtime](https://www.apollographql.com/docs/kotlin/advanced/no-runtime)[Authentication](https://www.apollographql.com/docs/kotlin/advanced/authentication)[WebSocket errors](https://www.apollographql.com/docs/kotlin/advanced/websocket-errors)[Batching operations](https://www.apollographql.com/docs/kotlin/advanced/query-batching)

### Development & Testing

[Testing overview](https://www.apollographql.com/docs/kotlin/testing/overview)[Mocking HTTP responses](https://www.apollographql.com/docs/kotlin/testing/mocking-http-responses)[Mocking GraphQL responses](https://www.apollographql.com/docs/kotlin/testing/mocking-graphql-responses)[Data builders](https://www.apollographql.com/docs/kotlin/testing/data-builders)[Android Studio plugin](https://www.apollographql.com/docs/kotlin/testing/android-studio-plugin)[Apollo Debug Server](https://www.apollographql.com/docs/kotlin/testing/apollo-debug-server)

### Advanced

[Uploading files](https://www.apollographql.com/docs/kotlin/advanced/upload)[Monitoring the network state](https://www.apollographql.com/docs/kotlin/advanced/network-connectivity)[Handling nullability](https://www.apollographql.com/docs/kotlin/advanced/nullability)[Experimental WebSockets](https://www.apollographql.com/docs/kotlin/advanced/experimental-websockets)[Using aliases](https://www.apollographql.com/docs/kotlin/advanced/using-aliases)[Using Java](https://www.apollographql.com/docs/kotlin/advanced/java)[Apollo AST](https://www.apollographql.com/docs/kotlin/advanced/apollo-ast)[Compiler plugins](https://www.apollographql.com/docs/kotlin/advanced/compiler-plugins)[JS Interoperability](https://www.apollographql.com/docs/kotlin/advanced/js-interop)[Response based codegen](https://www.apollographql.com/docs/kotlin/advanced/response-based)[Apollo Kotlin galaxy](https://www.apollographql.com/docs/kotlin/advanced/galaxy)

## Apollo Server

Apollo Server - v4âv5 (latest)

[Introduction](https://www.apollographql.com/docs/apollo-server)[Get started](https://www.apollographql.com/docs/apollo-server/getting-started)

### New in v4 and v5

[Migrating from Apollo Server 4](https://www.apollographql.com/docs/apollo-server/migration)[Migrating from Apollo Server 3](https://www.apollographql.com/docs/apollo-server/migration-from-v3)[Previous versions](https://www.apollographql.com/docs/apollo-server/previous-versions)[Changelog](https://github.com/apollographql/apollo-server/blob/main/packages/server/CHANGELOG.md)

### Defining a Schema

[Schema basics](https://www.apollographql.com/docs/apollo-server/schema/schema)[Unions and interfaces](https://www.apollographql.com/docs/apollo-server/schema/unions-interfaces)[Custom scalars](https://www.apollographql.com/docs/apollo-server/schema/custom-scalars)[Directives](https://www.apollographql.com/docs/apollo-server/schema/directives)

### Resolving Operations

[Resolvers](https://www.apollographql.com/docs/apollo-server/data/resolvers)[Sharing context](https://www.apollographql.com/docs/apollo-server/data/context)[Error handling](https://www.apollographql.com/docs/apollo-server/data/errors)[Subscriptions](https://www.apollographql.com/docs/apollo-server/data/subscriptions)

### Fetching Data

[Overview](https://www.apollographql.com/docs/apollo-server/data/fetching-data)[REST APIs](https://www.apollographql.com/docs/apollo-server/data/fetching-rest)

### Web Frameworks

[Integrations](https://www.apollographql.com/docs/apollo-server/integrations/integration-index)[Building integrations](https://www.apollographql.com/docs/apollo-server/integrations/building-integrations)[MERN stack tutorial](https://www.apollographql.com/docs/apollo-server/integrations/mern)

### Development Workflow

[Build and run queries](https://www.apollographql.com/docs/apollo-server/workflow/build-run-queries)[Request format](https://www.apollographql.com/docs/apollo-server/workflow/requests)[Generating TS types](https://www.apollographql.com/docs/apollo-server/workflow/generate-types)[Mocking](https://www.apollographql.com/docs/apollo-server/testing/mocking)[Integration testing](https://www.apollographql.com/docs/apollo-server/testing/testing)[Apollo Studio Explorer](https://www.apollographql.com/docs/studio/explorer/)

### Performance

[Caching](https://www.apollographql.com/docs/apollo-server/performance/caching)[Cache backends](https://www.apollographql.com/docs/apollo-server/performance/cache-backends)[Response Cache Eviction](https://www.apollographql.com/docs/apollo-server/performance/response-cache-eviction)[Automatic persisted queries](https://www.apollographql.com/docs/apollo-server/performance/apq)

### Security

[Auth](https://www.apollographql.com/docs/apollo-server/security/authentication)[CORS](https://www.apollographql.com/docs/apollo-server/security/cors)[Terminating SSL](https://www.apollographql.com/docs/apollo-server/security/terminating-ssl)[Proxy configuration](https://www.apollographql.com/docs/apollo-server/security/proxy-configuration)

### Deployment

[Lambda](https://www.apollographql.com/docs/apollo-server/deployment/lambda)[Heroku](https://www.apollographql.com/docs/apollo-server/deployment/heroku)

### Monitoring

[Metrics and logging](https://www.apollographql.com/docs/apollo-server/monitoring/metrics)[Health checks](https://www.apollographql.com/docs/apollo-server/monitoring/health-checks)

### API Reference

[ApolloServer](https://www.apollographql.com/docs/apollo-server/api/apollo-server)[startStandaloneServer](https://www.apollographql.com/docs/apollo-server/api/standalone)[expressMiddleware](https://www.apollographql.com/docs/apollo-server/api/express-middleware)

### Plugins

[Overview](https://www.apollographql.com/docs/apollo-server/builtin-plugins)

### Built-in

[Usage reporting](https://www.apollographql.com/docs/apollo-server/api/plugin/usage-reporting)[Schema reporting](https://www.apollographql.com/docs/apollo-server/api/plugin/schema-reporting)[Inline trace](https://www.apollographql.com/docs/apollo-server/api/plugin/inline-trace)[Drain HTTP server](https://www.apollographql.com/docs/apollo-server/api/plugin/drain-http-server)[Cache control](https://www.apollographql.com/docs/apollo-server/api/plugin/cache-control)[Landing pages](https://www.apollographql.com/docs/apollo-server/api/plugin/landing-pages)[Federated subscriptions](https://www.apollographql.com/docs/apollo-server/api/plugin/subscription-callback)

### Custom

[Creating plugins](https://www.apollographql.com/docs/apollo-server/integrations/plugins)[Event reference](https://www.apollographql.com/docs/apollo-server/integrations/plugins-event-reference)

### Using with Federation

### As a subgraph

[Setup](https://www.apollographql.com/docs/apollo-server/using-federation/apollo-subgraph-setup)[@apollo/subgraph reference](https://www.apollographql.com/docs/apollo-server/using-federation/api/apollo-subgraph)

### As a gateway

[Setup](https://www.apollographql.com/docs/apollo-server/using-federation/apollo-gateway-setup)[Gateway performance](https://www.apollographql.com/docs/apollo-server/using-federation/gateway-performance)[@apollo/gateway reference](https://www.apollographql.com/docs/apollo-server/using-federation/api/apollo-gateway)

## Apollo MCP Server

Apollo MCP Server - v1 (latest)

[Overview](https://www.apollographql.com/docs/apollo-mcp-server)[Quickstart](https://www.apollographql.com/docs/apollo-mcp-server/quickstart)[Define tools](https://www.apollographql.com/docs/apollo-mcp-server/define-tools)

### Configuration

[YAML Config Reference](https://www.apollographql.com/docs/apollo-mcp-server/config-file)[Custom Scalars](https://www.apollographql.com/docs/apollo-mcp-server/custom-scalars)

[Run the MCP Server](https://www.apollographql.com/docs/apollo-mcp-server/run)[Debugging](https://www.apollographql.com/docs/apollo-mcp-server/debugging)

### Deployment

[Overview](https://www.apollographql.com/docs/apollo-mcp-server/deploy)[Health Checks](https://www.apollographql.com/docs/apollo-mcp-server/health-checks)[CORS](https://www.apollographql.com/docs/apollo-mcp-server/cors)

[Authorization](https://www.apollographql.com/docs/apollo-mcp-server/auth)[Telemetry](https://www.apollographql.com/docs/apollo-mcp-server/telemetry)[Best Practices](https://www.apollographql.com/docs/apollo-mcp-server/best-practices)[Licensing](https://www.apollographql.com/docs/apollo-mcp-server/licensing)[Limitations](https://www.apollographql.com/docs/apollo-mcp-server/limitations)

### Guides

[Authorization with Auth0](https://www.apollographql.com/docs/apollo-mcp-server/guides/auth-auth0)

## Apollo Operator

[Overview](https://www.apollographql.com/docs/apollo-operator)

### Getting Started

[Install Operator](https://www.apollographql.com/docs/apollo-operator/get-started/install-operator)[Add Subgraphs](https://www.apollographql.com/docs/apollo-operator/get-started/add-subgraphs)[Deploy Supergraphs](https://www.apollographql.com/docs/apollo-operator/get-started/deploy-supergraph)

### Kubernetes Resources

### Supergraph

[Overview](https://www.apollographql.com/docs/apollo-operator/resources/supergraph)[Autoscaling your Supergraphs](https://www.apollographql.com/docs/apollo-operator/resources/supergraph/autoscalers)[Supergraph podTemplate](https://www.apollographql.com/docs/apollo-operator/resources/supergraph/pod_template)[Supergraph networking](https://www.apollographql.com/docs/apollo-operator/resources/supergraph/networking)

[SupergraphSchema](https://www.apollographql.com/docs/apollo-operator/resources/supergraphschema)[SupergraphSet](https://www.apollographql.com/docs/apollo-operator/resources/supergraphset)[Subgraph](https://www.apollographql.com/docs/apollo-operator/resources/subgraph)

### Workflows

[Overview](https://www.apollographql.com/docs/apollo-operator/workflows)[Single Cluster Setup](https://www.apollographql.com/docs/apollo-operator/workflows/single-cluster)[Multi-Cluster & Hybrid Setup](https://www.apollographql.com/docs/apollo-operator/workflows/multi-cluster)[Deploy Only](https://www.apollographql.com/docs/apollo-operator/workflows/deploy-only)

### Configuration

[Overview](https://www.apollographql.com/docs/apollo-operator/configuration)[Telemetry](https://www.apollographql.com/docs/apollo-operator/configuration/telemetry)[Controllers](https://www.apollographql.com/docs/apollo-operator/configuration/controllers)[OCI](https://www.apollographql.com/docs/apollo-operator/configuration/oci)[Private Registries](https://www.apollographql.com/docs/apollo-operator/configuration/private-registries)

[Security Best Practices](https://www.apollographql.com/docs/apollo-operator/security-best-practices)

[Apollo Client (Web)](react)

## 

On this page

Copy as MD

  * Initialization 

  * Configuration options 

  * Customizing cache IDs 

  * Calculating an object's cache ID 

  * Customizing identifier generation globally 

  * Customizing Type Policies 

  * Disabling normalization 

  * TypePolicy fields 

  * Overriding root operation types (uncommon) 

  * The fields property 




[ Home ](/docs/)

/ [ Apollo Client (Web) ](/docs/react)

/ [ Caching ](/docs/react/caching/overview)

/ [ Configuration ](/docs/react/caching/cache-configuration)

[ Apollo Client (Web) / ](/docs/react)

[ Caching ](/docs/react/caching/overview)

#  Configuring the Apollo Client cache 

Ask AI a question about this page

Ask with ChatGPT

Ask with ClaudeAsk with ChatGPT

* * *

This article describes cache setup and configuration. To learn how to interact with cached data, see [Reading and writing data to the cache](https://www.apollographql.com/docs/react/caching/cache-interaction).

## Initialization

Create an `InMemoryCache` object and provide it to the `ApolloClient` constructor, like so:

TypeScript

copy
    
    
    1import { InMemoryCache, ApolloClient } from "@apollo/client";
    2
    3const client = new ApolloClient({
    4  // ...other arguments...
    5  cache: new InMemoryCache(options),
    6});

The `InMemoryCache` constructor accepts a variety of [configuration options](https://www.apollographql.com/docs/react/caching/cache-configuration#configuration-options).

## Configuration options

You can configure the cache's behavior to better suit your application. For example, you can:

  * Customize the format of a particular type's [cache ID](https://www.apollographql.com/docs/react/caching/cache-configuration#customizing-cache-ids)

  * Customize the storage and retrieval of [individual fields](https://www.apollographql.com/docs/react/caching/cache-field-behavior/)

  * Define polymorphic type relationships for [fragment matching](https://www.apollographql.com/docs/react/caching/cache-configuration#possibletypes)

  * Define patterns for [pagination](https://www.apollographql.com/docs/react/pagination/overview/)

  * Manage client-side [local state](https://www.apollographql.com/docs/react/local-state/local-state-management/)




To customize cache behavior, you provide a configuration object to the `InMemoryCache` constructor. This object supports the following fields:

Name /  
Type | Description  
---|---  
  
###### `resultCaching`

`Boolean`| If `true`, the cache returns an identical (`===`) response object for every execution of the same query, as long as the underlying data remains unchanged. This helps you detect changes to a query's result.The default value is `true`.  
  
###### `resultCacheMaxSize`

`number`| The limit of the number of result objects that will be retained in memory to speed up repeated reads to the cache.The default value is `Math.pow(2, 16)`.  
  
###### `possibleTypes`

`Object`| Include this object to define polymorphic relationships between your schema's types. Doing so enables you to look up cached data by interface or by union.Each key in the object is the `__typename` of an interface or union, and the corresponding value is an array of the `__typename`s of the types that belong to that union or implement that interface.For an example, see [Defining `possibleTypes` manually](https://www.apollographql.com/docs/react/data/fragments/#defining-possibletypes-manually).  
  
###### `typePolicies`

`Object`| Include this object to customize the cache's behavior on a type-by-type basis.Each key in the object is the `__typename` of a type to customize, and the corresponding value is a [`TypePolicy` object](https://www.apollographql.com/docs/react/caching/cache-configuration#typepolicy-fields).  
  
###### `dataIdFromObject`

`Function`| A function that takes a response object and returns a unique identifier to be used when normalizing the data in the store.For details, see [Customizing identifier generation globally](https://www.apollographql.com/docs/react/caching/cache-configuration#customizing-identifier-generation-globally).  
  
## Customizing cache IDs

You can customize how the `InMemoryCache` generates cache IDs for individual types in your schema ([see the default behavior](https://www.apollographql.com/docs/react/caching/overview/#2-generate-cache-ids)). This is helpful especially if a type uses a field (or fields!) _besides_ `id` or `_id` as its unique identifier.

To accomplish this, you define a `TypePolicy` for each type you want to customize. You specify all of your cache's `typePolicies` in [the `options` object you provide to the `InMemoryCache` constructor](https://www.apollographql.com/docs/react/caching/cache-configuration#configuration-options).

Include a `keyFields` field in relevant `TypePolicy` objects, like so:

TypeScript

copy
    
    
    1const cache = new InMemoryCache({
    2  typePolicies: {
    3    Product: {
    4      // In an inventory management system, products might be identified
    5      // by their UPC.
    6      keyFields: ["upc"],
    7    },
    8    Person: {
    9      // In a user account system, the combination of a person's name AND email
    10      // address might uniquely identify them.
    11      keyFields: ["name", "email"],
    12    },
    13    Book: {
    14      // If one of the keyFields is an object with fields of its own, you can
    15      // include those nested keyFields by using a nested array of strings:
    16      keyFields: ["title", "author", ["name"]],
    17    },
    18    AllProducts: {
    19      // Singleton types that have no identifying field can use an empty
    20      // array for their keyFields.
    21      keyFields: [],
    22    },
    23    Store: {
    24      // If you need to disable normalization, set the keyFields to false
    25      // and the object will be embedded in the parent
    26      keyFields: false,
    27    },
    28    Location: {
    29      // You can also use a function to determine any of the values above.
    30      // The first argument is the reference to the record to be written, and the second is the runtime context
    31      keyFields: (location, context) => {
    32        if (context.readField("state")) {
    33          return ["city", "state", "country"];
    34        } else {
    35          return ["city", "country"];
    36        }
    37      },
    38    },
    39  },
    40});

This example shows a variety of `typePolicies` with different `keyFields`:

  * The `Product` type uses its `upc` field as its identifying field.

  * The `Person` type uses the combination of both its `name` _and_ `email` fields.

  * The `Book` type includes a _sub field_ as part of its cache ID.

    * The `["name"]` item indicates that the `name` field of the _previous_ field in the array (`author`) is part of the cache ID. The `Book`'s `author` field must be an object that includes a `name` field for this to be valid.

    * A valid cache ID for the `Book` type has the following structure:

Text

copy
          
          1Book:{"title":"Fahrenheit 451","author":{"name":"Ray Bradbury"}}

  * The `AllProducts` type illustrates a special strategy for a **singleton** type. If the cache will only ever contain one `AllProducts` object and that object has _no_ identifying fields, you can provide an empty array for its `keyFields`.

  * The `Store` type provides an example of how you can [disable normalization](https://www.apollographql.com/docs/react/caching/cache-configuration/#disabling-normalization) by setting the keyFields to `false`

  * The `Location` type provides an example of using custom function given object and runtime context to calculate what fields should be used for the key field selection.

    * Keep in mind that the first argument here is a reference to the record that will be written. As such, it does NOT include subselected fields, only scalar fields, and it contains aliases from the operation. If you need to read the real type you can use `context.storeObject`. To read even more indepth about how this function can work the best source will be our own [test cases for the cache policies](https://github.com/apollographql/apollo-client/blob/8bc7d4d406402962bf5151cdd2c5c75c9398d10c/src/cache/inmemory/__tests__/policies.ts#L5543-L5622)




If an object has multiple `keyFields`, the cache ID always lists those fields in the same order to ensure uniqueness.

Note that these `keyFields` strings always refer to the canonical field names defined in the schema. This means that ID computation is _not_ sensitive to field aliases.

### Calculating an object's cache ID

If you define a custom cache ID that uses multiple fields, it can be challenging to calculate and provide that ID to methods that require it (such as `cache.readFragment`).

To help with this, you can use the `cache.identify` method to calculate the cache ID for any normalized object you fetch from your cache. See [Obtaining an object's custom ID](https://www.apollographql.com/docs/react/caching/cache-interaction/#obtaining-an-objects-cache-id).

### Customizing identifier generation globally

If you need to define a single fallback `keyFields` function that isn't specific to any particular `__typename`, you can use the `dataIdFromObject` function that was introduced in Apollo Client 2.x:

TypeScript

copy
    
    
    1import { defaultDataIdFromObject } from "@apollo/client";
    2
    3const cache = new InMemoryCache({
    4  dataIdFromObject(responseObject) {
    5    switch (responseObject.__typename) {
    6      case "Product":
    7        return `Product:${responseObject.upc}`;
    8      case "Person":
    9        return `Person:${responseObject.name}:${responseObject.email}`;
    10      default:
    11        return defaultDataIdFromObject(responseObject);
    12    }
    13  },
    14});

> The `dataIdFromObject` API is included in Apollo Client 3 to ease the transition from Apollo Client 2.x.

Notice that the above function still uses different logic to generate keys based on an object's `__typename`. In a case like this, you should almost always define `keyFields` arrays for the `Product` and `Person` types via `typePolicies`.

This code also has the following drawbacks:

  * It's sensitive to aliasing mistakes.

  * It does nothing to protect against undefined object properties.

  * Accidentally using different key fields at different times can cause inconsistencies in the cache.




### Customizing Type Policies

After creating an `InMemoryCache` instance, you can use the `addTypePolicies` method to add or modify type policies.

Here is an example of how to use the `addTypePolicies` method:

TypeScript

copy
    
    
    1const cache = new InMemoryCache({
    2  typePolicies: {
    3    Person: {
    4      fields: {
    5        name: {
    6          read(name = "UNKNOWN NAME") {
    7            return name.toUpperCase();
    8          },
    9        },
    10      },
    11    },
    12  },
    13});
    14
    15// Add a type policy to the cache.
    16cache.policies.addTypePolicies({
    17  Person: {
    18    fields: {
    19      email: {
    20        read(email = "unknown@example.com") {
    21          return email;
    22        },
    23      },
    24    },
    25  },
    26});

The code creates an `InMemoryCache` with a custom type policy for the `Person` type. The type policy specifies that if the `name` field is not available in the cache, it should return a default value of "UNKNOWN NAME" and converts it to uppercase.

Then, the code adds an additional type policy to the cache using `cache.policies.addTypePolicies`. This new type policy is related to the `Person` type and its `email` field. The custom read function specifies that if the email field is not available in the cache, it should return a default value of "[unknown@example.com](mailto:unknown@example.com)".

Overall, the code sets up caching behaviors for the `Person` type, ensuring that default values are provided for the `name` and `email` fields if they are not present in the cache.

### Disabling normalization

You can instruct the `InMemoryCache` _not_ to normalize objects of a particular type. This can be useful for metrics and other transient data that's identified by a timestamp and never receives updates.

To disable normalization for a type, define a `TypePolicy` for the type (as shown in [Customizing cache IDs](https://www.apollographql.com/docs/react/caching/cache-configuration#customizing-cache-ids)) and set the policy's `keyFields` field to `false`.

Objects that are not normalized are instead embedded within their _parent_ object in the cache. You can't access these objects directly, but you can access them via their parent.

## `TypePolicy` fields

To customize how the cache interacts with specific types in your schema, you can pass the `InMemoryCache` constructor an object that maps `__typename` strings to `TypePolicy` objects.

A `TypePolicy` object can include the following fields:

TypeScript

copy
    
    
    1type TypePolicy = {
    2  // Allows defining the primary key fields for this type, either using an
    3  // array of field names, a function that returns an arbitrary string, or
    4  // false to disable normalization for objects of this type.
    5  keyFields?: KeySpecifier | KeyFieldsFunction | false;
    6
    7  // If your schema uses a custom __typename for any of the root Query,
    8  // Mutation, and/or Subscription types (rare), set the corresponding
    9  // field below to true to indicate that this type serves as that type.
    10  queryType?: true;
    11  mutationType?: true;
    12  subscriptionType?: true;
    13
    14  fields?: {
    15    [fieldName: string]:
    16      | FieldPolicy<StoreValue>
    17      | FieldReadFunction<StoreValue>;
    18  };
    19};
    20
    21// Recursive type aliases are coming in TypeScript 3.7, so this isn't the
    22// actual type we use, but it's what it should be:
    23type KeySpecifier = (string | KeySpecifier)[];
    24
    25type KeyFieldsFunction = (
    26  object: Readonly<StoreObject>,
    27  context: {
    28    typename: string;
    29    selectionSet?: SelectionSetNode;
    30    fragmentMap?: FragmentMap;
    31  }
    32) => string | null | void;

### Overriding root operation types (uncommon)

In addition to `keyFields`, a `TypePolicy` can indicate that its type represents the root query, mutation, or subscription type by setting `queryType`, `mutationType`, or `subscriptionType` to `true`:

TypeScript

copy
    
    
    1const cache = new InMemoryCache({
    2  typePolicies: {
    3    UnconventionalRootQuery: {
    4      // The RootQueryFragment can only match if the cache knows the __typename
    5      // of the root query object.
    6      queryType: true,
    7    },
    8  },
    9});
    10
    11const result = cache.readQuery({
    12  query: gql`
    13    query MyQuery {
    14      ...RootQueryFragment
    15    }
    16    fragment RootQueryFragment on UnconventionalRootQuery {
    17      field1
    18      field2 {
    19        subfield
    20      }
    21    }
    22  `,
    23});
    24
    25const equivalentResult = cache.readQuery({
    26  query: gql`
    27    query MyQuery {
    28      field1
    29      field2 {
    30        subfield
    31      }
    32    }
    33  `,
    34});

The cache usually obtains `__typename` information by adding the `__typename` field to every query selection set it sends to the server. It could technically use this same method for the outermost selection set of every operation, but the `__typename`s of the root query and mutation are almost always `"Query"` and `"Mutation"`, so the cache assumes those common defaults unless instructed otherwise in a `TypePolicy`.

For most objects in a graph, the `__typename` field is vital for proper identification and normalization. For the root query and mutation types, the `__typename` is not nearly as useful or important, because those types are singletons with only one instance per client.

### The `fields` property

The final property within `TypePolicy` is the `fields` property, which enables you to [customize the behavior of individual cached fields](https://www.apollographql.com/docs/react/caching/cache-field-behavior).

[PreviousCaching in Apollo Client](/docs/react/caching/overview)

[NextReading and writing data to the cache](/docs/react/caching/cache-interaction)

Give FeedbackFeedback

[ Edit on GitHub ](https://github.com/apollographql/apollo-client/blob/main/./docs/source/caching/cache-configuration.mdx) [ Ask Community ](https://community.apollographql.com/)

[ ](https://www.apollographql.com)

(C) 2025 Apollo Graph Inc., d/b/a Apollo GraphQL. 

[ Privacy Policy ](https://www.apollographql.com/privacy-policy)

## Company

  * [ About Apollo ](https://www.apollographql.com/about-us)
  * [ Careers ](https://www.apollographql.com/careers)
  * [ Partners ](https://www.apollographql.com/partners)



## Resources

  * [ Blog ](https://blog.apollographql.com)
  * [ Tutorials ](https://www.apollographql.com/tutorials)
  * [ Content Library ](https://www.apollographql.com/resources)



## Get in touch

  * [ Contact Sales ](https://www.apollographql.com/contact-sales)
  * [ Contact Support ](https://www.apollographql.com/support)
