Apollo Client

Product · Developer tool · IT & helpdesk by Apollo GraphQL

The comprehensive state management library for GraphQL.

Apollo Client is a powerful state management library for JavaScript and mobile apps that automates data fetching and caching with GraphQL. It is the industry standard for developers building data-driven applications with React, iOS, and Android.

Price
From 0 USD
Languages
JavaScript, TypeScript, Swift, Kotlin, Java

Category: Developer Tools

Platforms
Web, iOS, Android, JVM
Programming languages
JavaScript, TypeScript, Swift, Java, Kotlin
Editors and tools
VS Code, Chrome DevTools, Firefox DevTools
License
Open Source
Deployment
Client-side library for web and mobile applications
Core Library
@apollo/client
  • Normalized request and response caching
  • Built-in integration for React hooks and Suspense
  • Support for @defer incremental data delivery
  • Native SDKs for iOS (Swift) and Android (Kotlin)
  • Declarative data fetching without manual loading states

Overview

Apollo Client is a comprehensive state management library for JavaScript, iOS, and Android that simplifies data management with GraphQL. It enables developers to fetch, cache, and modify application data while automatically updating the user interface in a declarative way. The library is designed for modern development practices, offering built-in integration with React features like hooks and Suspense. It supports advanced GraphQL capabilities including normalized caching, real-time subscriptions, and incremental data delivery via the @defer directive. Apollo Client is universally compatible with any build setup and can be incrementally adopted into existing applications.

Data Management and Fetching

  • Declarative Data Fetching: Developers can write a query and receive data without manually tracking loading states or managing boilerplate code.
  • Normalized Caching: The library includes a normalized request and response cache that responds almost immediately to queries with cached data.
  • State Management: Apollo Client manages both local and remote data with GraphQL, consolidating application state into a single source.
  • React Integration: The core library provides built-in integration with React, including support for hooks and Suspense.

Advanced GraphQL Features

  • Incremental Data Delivery: The library supports receiving data for specific fields incrementally with the @defer directive to improve perceived performance.
  • GraphQL Subscriptions: Real-time updates are supported via GraphQL subscriptions for live data streaming to the user interface.
  • Persisted Queries: Apollo Client supports safelisting with persisted queries to enhance security and performance.
  • Optimistic Mutation Results: Optimistic UI results allow mutations to update the interface immediately before the server responds.

Developer Experience and Tooling

  • TypeScript Support: Apollo Client provides helpful tooling for TypeScript, including type-safe query results and configuration.
  • Browser Devtools: Developers can use dedicated extensions for Chrome and Firefox to inspect the cache and track operations.
  • Universal Compatibility: The library is universally compatible with any build setup and any GraphQL API.
  • Incrementally Adoptable: Apollo Client can be dropped into any JavaScript or TypeScript app and incorporated feature by feature.

Use cases

  • Web developers use Apollo Client to manage local and remote application state in React apps without manual boilerplate.
  • Mobile engineers implement Apollo iOS or Kotlin to fetch typed data for native applications with built-in caching.
  • Frontend teams use @defer to load non-critical page sections incrementally, improving perceived site speed.
  • Application developers use GraphQL subscriptions to provide real-time data updates for live dashboards or chat features.

Specifications

Platforms
Web, iOS, Android, JVM
Programming languages
JavaScript, TypeScript, Swift, Java, Kotlin
Editors and tools
VS Code, Chrome DevTools, Firefox DevTools
Integrations
React, Angular, Vue, Svelte, Solid.js, Ember, Meteor, Next.js, React Router, TanStack Start, React Native
License
Open Source
Deployment
Client-side library for web and mobile applications
Core Library
@apollo/client
Primary Framework
React
Mobile Support
iOS (Swift), Android (Kotlin/Java)
Web Frameworks
Angular, Vue, Svelte, Solid.js, Ember
Caching Type
Normalized InMemoryCache
Data Delivery
Incremental (@defer) and Real-time (Subscriptions)
Tooling Support
TypeScript, Chrome/Firefox Devtools, VS Code

How it works

  1. Installation: Install the core library and its dependencies using a package manager like npm or yarn for web projects.
  2. Client Configuration: Initialize the ApolloClient with a GraphQL endpoint URL and a cache instance like InMemoryCache.
  3. Provider Setup: Wrap the application in an ApolloProvider to make the client available to the entire component tree.
  4. Data Operations: Use hooks like useQuery or useMutation to fetch and modify data directly within components.

Pricing

Open Source
Free

FAQ

Which frontend frameworks are supported?

Apollo Client supports React, Angular, Vue, Svelte, Solid.js, Ember, Meteor, and Web Components.

Does it work with native mobile apps?

Yes, Apollo Client provides native support for iOS via Swift and Android via Java and Kotlin.

How does the caching mechanism work?

Apollo Client uses a normalized cache to store query results locally, allowing it to skip network requests when data is already available.

Does it support real-time data?

Yes, it supports the @defer directive for incremental data delivery and GraphQL subscriptions for real-time updates.

Added by AntSpace from public sources (apollographql.com).

Related

More products by Apollo GraphQL