# apollographql/react-apollo

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/apollographql-react-apollo).**

6,799 stars · 764 forks · JavaScript · MIT · archived

## Links

- GitHub: https://github.com/apollographql/react-apollo
- Homepage: https://www.apollographql.com/docs/react/
- awesome-repositories: https://awesome-repositories.com/repository/apollographql-react-apollo.md

## Topics

`apollo` `graphql` `react` `redux` `ssr`

## Description

React Apollo is a React-specific GraphQL data fetching library that binds Apollo Client to components through declarative hooks for queries, mutations, and subscriptions. It provides a declarative approach to GraphQL query execution where components declare their data requirements and automatically receive loading, error, and data states without managing request lifecycle code.

The library distinguishes itself through a normalized cache layer that deduplicates entities and serves repeated requests without network calls, combined with incremental result streaming via the `@defer` directive for partial query field delivery. It supports persisted operations safelisting for security, where approved queries are registered with the server so only pre-authorized operations are accepted. A fine-grained network status enumeration exposes distinct states for loading, refetching, polling, and pagination, enabling precise UI feedback.

The library offers provider-based client injection through a context provider at the component tree root, making the GraphQL client accessible to all descendant hooks. It includes configurable caching strategies with cache-first and network-only fetch policies, conditional query skipping using a type-safe token, and support for real-time subscriptions that push live data from the server without polling. Polling and refetch mechanisms allow queries to be re-executed at intervals or on demand, with partial error handling that can either discard all data on error or keep partial results when some fields fail.

## Tags

### Web Development

- [React GraphQL Hooks](https://awesome-repositories.com/f/web-development/react-graphql-hooks.md) — Binds Apollo Client to React components with hooks for declarative GraphQL queries, mutations, and subscriptions.
- [Declarative GraphQL Lifecycles](https://awesome-repositories.com/f/web-development/asynchronous-request-managers/query-lifecycle-management/declarative-graphql-lifecycles.md) — Manages loading, error, and data states of GraphQL queries in React components without manual request lifecycle code.
- [Declarative Data Hooks](https://awesome-repositories.com/f/web-development/declarative-data-hooks.md) — Provides declarative React hooks that automatically manage GraphQL query loading, error, and data states.
- [GraphQL Query Hooks](https://awesome-repositories.com/f/web-development/event-listeners/execution-lifecycle-hooks/query-execution-hooks/graphql-query-hooks.md) — Executes GraphQL queries via React hooks and returns loading, error, and data states for UI rendering. ([source](https://www.apollographql.com/docs/react/essentials/queries.html))
- [Data Polling](https://awesome-repositories.com/f/web-development/data-polling.md) — Re-executes GraphQL queries periodically at set intervals to keep displayed data near-real-time with the server. ([source](https://www.apollographql.com/docs/react/essentials/queries.html))

### Data & Databases

- [Query Result Caching](https://awesome-repositories.com/f/data-databases/data-engineering-infrastructure/caching-performance/caching-strategies/query-result-caching.md) — Caches fetched query data locally so identical queries return instantly without making a network request. ([source](https://www.apollographql.com/docs/react/essentials/queries.html))
- [Client Query Execution](https://awesome-repositories.com/f/data-databases/graphql-integrations/client-query-execution.md) — Provides a declarative hook-based API for executing GraphQL queries and managing their lifecycle. ([source](https://www.apollographql.com/docs/react/))
- [GraphQL Normalized Caches](https://awesome-repositories.com/f/data-databases/normalized-data-caching/graphql-normalized-caches.md) — Ships a normalized client-side cache that deduplicates GraphQL entities and serves repeated requests without network calls.
- [Manual Query Triggers](https://awesome-repositories.com/f/data-databases/query-execution-triggers/manual-query-triggers.md) — Defers GraphQL query execution until a manual trigger like a button click by returning an execution function from a hook. ([source](https://www.apollographql.com/docs/react/essentials/queries.html))
- [GraphQL Subscriptions](https://awesome-repositories.com/f/data-databases/real-time-data-streaming/graphql-subscriptions.md) — Implements real-time GraphQL subscriptions that push live data from the server to React components without polling.
- [GraphQL Deferred Streams](https://awesome-repositories.com/f/data-databases/structured-data-extraction/incremental-result-streams/graphql-deferred-streams.md) — Implements incremental query result streaming via the @defer directive for partial field delivery. ([source](https://www.apollographql.com/docs/react/))

### Development Tools & Productivity

- [Provider-Based Clients](https://awesome-repositories.com/f/development-tools-productivity/graphql-clients/provider-based-clients.md) — Wraps the component tree root with a provider that makes the GraphQL client accessible to all child components. ([source](https://cdn.jsdelivr.net/gh/apollographql/react-apollo@master/README.md))

### Networking & Communication

- [Context Provider Injection](https://awesome-repositories.com/f/networking-communication/http-clients/dependency-injection-providers/context-provider-injection.md) — Uses a React context provider at the component tree root to inject the GraphQL client into all descendant hooks.

### Software Engineering & Architecture

- [Query Hooks](https://awesome-repositories.com/f/software-engineering-architecture/query-optimization/graphql/query-hooks.md) — Ships React hooks that execute GraphQL queries and expose loading, error, and data states to components. ([source](https://www.apollographql.com/docs/react/api/react-apollo.html))
- [Query Refetching](https://awesome-repositories.com/f/software-engineering-architecture/custom-action-handlers/on-demand-action-executions/query-refetching.md) — Triggers fresh GraphQL query execution in response to user actions, optionally with new variables. ([source](https://www.apollographql.com/docs/react/essentials/queries.html))
- [GraphQL Deferred Fields](https://awesome-repositories.com/f/software-engineering-architecture/deferred-resolution-patterns/graphql-deferred-fields.md) — Implements the @defer directive for incremental delivery of GraphQL query fields as partial results.
- [GraphQL Query Polling](https://awesome-repositories.com/f/software-engineering-architecture/event-driven-architectures/polling-mechanisms/graphql-query-polling.md) — Re-executes GraphQL queries at intervals or on demand with distinct network statuses for each trigger type.
- [Polling and Refetching](https://awesome-repositories.com/f/software-engineering-architecture/query-optimization/graphql/polling-and-refetching.md) — Supports configurable polling intervals and on-demand refetching with distinct network statuses for each trigger type.

### User Interface & Experience

- [GraphQL Data Fetching](https://awesome-repositories.com/f/user-interface-experience/content-rendering-components/server-side-data-fetching/graphql-data-fetching.md) — Fetches data from a GraphQL endpoint and automatically re-renders React components when that data changes. ([source](https://cdn.jsdelivr.net/gh/apollographql/react-apollo@master/README.md))

### DevOps & Infrastructure

- [GraphQL Fetch Policies](https://awesome-repositories.com/f/devops-infrastructure/caching-layers/response-cache-policies/graphql-fetch-policies.md) — Offers configurable fetch policies like cache-first and network-only to control how queries retrieve data. ([source](https://www.apollographql.com/docs/react/essentials/queries.html))

### Security & Cryptography

- [Persisted Operation Enforcement](https://awesome-repositories.com/f/security-cryptography/authorization-middleware/persisted-operation-enforcement.md) — Supports persisted operations safelisting where approved queries are registered with the server for security. ([source](https://www.apollographql.com/docs/react/))
