[๐Ÿš€Apollo] Cache - Configuration

1651 ๋‹จ์–ด apolloConfigurationCacheCache

apollo ๊ณต์‹๋ฌธ์„œ๋ฅผ ๋ฒˆ์—ญํ•œ ๊ธ€ ์ž…๋‹ˆ๋‹ค.

Initialization

import { InMemoryCache, ApolloClient } from '@apollo/client';

const client = new ApolloClient({
  // ...other arguments...
  cache: new InMemoryCache(options)
});

Configuration options

  • Specify custom primary key fields
  • Customize the storage and retrieval of individual fields
  • Customize the interpretation of field arguments
  • Define supertype-subtype relationships for fragment matching
  • Define patterns for pagination
  • Manage client-side local state

Customizing cache IDs

  • ํŠน๋ณ„ํ•œ ๊ฒฝ์šฐ๋ผ๋ฉด ID๋ฅผ customizing ํ•  ์ˆ˜ ์žˆ๋‹ค.
  • ๋‚œ ํ•˜์ง€ ์•Š์„ ๊ฒƒ์ด๊ธฐ ๋•Œ๋ฌธ์— ์ƒ๋žต..

TypePolicy fields

  • ์ค‘์š”ํ•œ ๊ฑด ์•„๋‹Œ ๊ฒƒ ๊ฐ™์•„์„œ ์ƒ๋žต!

์ข‹์€ ์›นํŽ˜์ด์ง€ ์ฆ๊ฒจ์ฐพ๊ธฐ