Skip to content

Latest commit

 

History

History
22 lines (15 loc) · 908 Bytes

File metadata and controls

22 lines (15 loc) · 908 Bytes

Data layer

apps/web has two coexisting systems for data fetching. Before adding a fetch, check which one the slice already uses and don't mix them without a reason.

1. TanStack Query + @normy/react-query

TanStack Query, wrapped by @normy/react-query's QueryNormalizerProvider, provides normalized cache updates (one entity updates everywhere it appears across queries).

2. Gravity UI DataSource

@languages-learner/data-source exposes a shared dataManager (Gravity UI DataSource) through DataManagerContext.

Choosing

  • If a slice is already wired to one system, continue with it.
  • Data coming from the backend via the generated SDK is described in api-contract.md: createSdk(supabase, options) attaches the caller's access token to every request. SSR callers must pass an absolute baseUrl (the relative /api only resolves in the browser).