calypso-react-query-migration

Installation
SKILL.md

Calypso React Query Migration

Target architecture: fetchers in @automattic/api-corequery/mutation options in @automattic/api-queriescomponents call useQuery() / useMutation() directly.

Two source patterns migrate into it:

  1. Redux data-layer (dispatchRequest + http actions in client/state/data-layer/wpcom/read/)
  2. @automattic/data-stores Reader hooks (custom hooks using wpcomRequest)

Quick Reference: Where Things Go

What Where
API fetcher packages/api-core/src/read-{name}/fetchers.ts
Mutators packages/api-core/src/read-{name}/mutators.ts
Response types packages/api-core/src/read-{name}/types.ts
Barrel packages/api-core/src/read-{name}/index.ts + add to packages/api-core/src/index.ts
Query/mutation options packages/api-queries/src/read-{name}.ts + add to packages/api-queries/src/index.ts
Bridge component (if kept) client/components/data/query-reader-{name}/index.tsx
Component tests client/components/data/query-reader-{name}/test/index.test.tsx
Related skills
Installs
1
GitHub Stars
12.6K
First Seen
11 days ago