[๐Ÿš€Apollo] Cache - Configuration

Jake_Youngยท2021๋…„ 9์›” 17์ผ
0
post-thumbnail

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

  • ์ค‘์š”ํ•œ ๊ฑด ์•„๋‹Œ ๊ฒƒ ๊ฐ™์•„์„œ ์ƒ๋žต!
profile
์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ์™€ ํŒŒ์ด์ฌ ๊ทธ๋ฆฌ๊ณ  ์ปดํ“จํ„ฐ์™€ ๋„คํŠธ์›Œํฌ

0๊ฐœ์˜ ๋Œ“๊ธ€