web-data-fetching-graphql-apollo
Installation
SKILL.md
Apollo Client Patterns
Quick Guide: Apollo stores every entity once, keyed by
__typenameplus itskeyFields, and re-renders everything watching it. Most of the difficulty is in the cache rather than the hooks:keyFieldsdecides identity,keyArgsdecides how many cache entries a paginated field gets, and an optimistic response missing__typenamefails to normalize without saying so. v3.9 added the Suspense hooks; v4 moved the React hooks to@apollo/client/reactand typed the error classes.
Detailed Resources:
- examples/core.md — codegen config, client and link chain,
useQuery,useLazyQuery, mutations with cache updates - examples/pagination.md —
fetchMorewith an observer, relay and offset type policies - examples/fragments.md — fragment definition, composition and use in queries
- examples/error-handling.md — partial data rendering, global error link
- examples/subscriptions.md — split link over
graphql-ws,useSubscriptionwriting to cache - examples/suspense.md —
useSuspenseQuery,useLoadableQuery,useBackgroundQuery,createQueryPreloader - examples/testing.md —
MockedProvider, mock shapes, asserting cache updates, schema-based testing - reference.md — fetch/error policy, network status and cache method tables, v3 → v4 migration