"Apollo Client integration for Griot's GraphQL reads: single client, InMemoryCache typePolicies, colocated fragments, refetch discipline."
Install
npx skillscat add donartkins/griot/apollo-graphql Install via the SkillsCat registry.
SKILL.md
Apollo GraphQL Skill
Client
// src/lib/apolloClient.ts
export const apolloClient = new ApolloClient({
link: new HttpLink({ uri: import.meta.env.VITE_API_URL + "/graphql", headers: () => ({ authorization: Bearer… }) }),
cache: new InMemoryCache({ typePolicies: { Task: { fields: { order: { merge: false } } } } }),
});Rules
- GraphQL reads: dashboard, boards, task detail. Mutations that Apollo handles (board/task moves) use optimistic updates.
- Fragments colocate with components (
BoardTaskCard.fragment.ts). typePoliciesprevent reorder merge bugs.- Server data never enters Zustand; select from the Apollo cache.
Verify
- Board reorder keeps cache sane; no duplicate key warnings in console.