• Solutions
  • Ecosystem
  • Blog
  • Our Services
  • About Us
  • Contact Us

Apollo Angular

GraphQL Client for Angular Framework

GitHubGitHub
  • Introduction
  • Getting Started
  • Fetching
    • Queries
    • Mutations
    • Subscriptions
    • Query, Mutation, Subscription Services
    • Network Layer
    • Pagination
    • Using Fragments
    • Error Handling
  • Caching
    • Configuring the Cache
    • Reading and Writing Data to the Cache
    • Garbage Collection and Cache Eviction
    • Customizing the Behavior of Cached Fields
    • Advanced Topics on Caching
  • Local State
    • Managing Local State
    • Managing State with Field Policies
    • Reactive Variables
  • Development and Testing
    • TypeScript
    • Testing
    • Mocking New Schema Capabilities
    • Developer Tools
  • Performance
    • Improving Performance
    • Optimistic UI
    • Server Side Rendering
  • Recipes
    • Simple Example
    • Automatic Persisted Queries
    • Angular CLI
    • Webpack Loader
    • Authentication
    • Multiple Clients
    • Integrating with NativeScript
  • Migration Guide
  • v3
    • Introduction
    • Get Started
    • Fetching
      • Queries
      • Mutations
      • Subscriptions
      • Query, Mutation, Subscription Services
      • Network Layer
      • Pagination
      • Using Fragments
      • Error Handling
    • Caching
      • Configuration
      • Reading and Writing
      • Garbage Collection
      • Customizing Field Behavior
      • Advanced Topics
    • Local State
      • Managing Local State
      • Managing State with Field Policies
      • Reactive Variables
    • Development and Testing
      • TypeScript
      • Testing
      • Mocking New Schema Capabilities
      • Developer Tools
    • Performance
      • Improving Performance
      • Optimistic UI
      • Server Side Rendering
    • Recipes
      • Simple Example
      • Automatic Persisted Queries
      • Angular CLI
      • Webpack Loader
      • Authentication
      • Multiple Clients
      • Integrating with NativeScript
    • Migration Guide
  • v2
    • Introduction
    • Getting Started
    • Fetching
      • Queries
      • Mutations
      • Subscriptions
      • Query, Mutation, Subscription Services
      • Network Layer
      • Pagination
      • Using Fragments
      • Error Handling
    • Caching
      • Configuring the Cache
      • Reading and Writing Data to the Cache
      • Garbage Collection and Cache Eviction
      • Customizing the Behavior of Cached Fields
      • Advanced Topics on Caching
    • Local State
      • Managing Local State
      • Managing State with Field Policies
      • Reactive Variables
    • Development and Testing
      • TypeScript
      • Testing
      • Mocking New Schema Capabilities
      • Developer Tools
    • Performance
      • Improving Performance
      • Optimistic UI
      • Server Side Rendering
    • Recipes
      • Simple Example
      • Automatic Persisted Queries
      • Angular CLI
      • Webpack Loader
      • Authentication
      • Multiple Clients
      • Integrating with NativeScript
    • Migration Guide
  • v1
    • Introduction
    • Migration Guide
    • Basics
      • Setup and Options
      • Queries
      • Mutations
      • Query, Mutation, Subscription Services
      • Network layer (Apollo Link)
      • Apollo Cache
      • Local State Management
    • Features
      • Error Handling
      • Direct Cache Access
      • Optimistic UI
      • Updating the Store
      • Using Fragments
      • Subscriptions
      • Integrating with NativeScript
      • Multiple Clients
      • Static Typing
    • Guides
      • State Management
      • Testing Apollo in Angular
      • Tools and Packages
    • Recipes
      • Small Example
      • Query Splitting
      • Pagination
      • Authentication
      • Prefetching Data
      • Server Side Rendering
      • Webpack Loader
      • Meteor
      • Angular CLI
      • Apollo Angular Boost migration
Question? Give us feedback →Edit this page on GitHub
  • v2
  • Caching
  • Reading and Writing Data to the Cache

Reading and Writing Data to the Cache

Apollo Client provides three methods for reading and writing data to the cache:

  • readQuery and readFragment
  • writeQuery and writeFragment
  • cache.modify (a method of InMemoryCache)

Please read the "Reading and writing data to the cache" chapter on Apollo Client documentation.

Last updated on October 10, 2022
Configuring the CacheGarbage Collection and Cache Eviction

PRODUCTS

  • Hive
  • Yoga
  • Envelop
  • Inspector
  • Code Generator
  • Mesh
  • Tools
  • Modules
  • ESLint
  • Config
  • Scalars
  • Helix
  • Shield
  • Swift
  • CLI
  • SOFA
  • Stencil
  • Angular
  • WhatsApp
  • KitQL

RESOURCES

  • Press Kit

COMPANY

  • About
  • Blog
  • Newsletter
  • Open Source
  • Services
  • GitHub

COMMUNITY

  • Twitter
  • LinkedIn
  • Discord
  • Medium
  • YouTube