Subscribe to a single normalized entity: populates the graph via fetch/normalize, dedupes in-flight work, and revalidates when stale. Solves “query-owned silos” by keeping one canonical record every list/detail reads through.
fetch
normalize
Entity query instruction (EntityQueryOptions): type, id, fetch, normalize, optional staleTime / enabled
EntityQueryOptions
type
id
staleTime
enabled
Merged entity (entities + patches), loading/error/stale flags, and refetch
entities
patches
refetch
const { data, isLoading, refetch } = useEntity({ type: "Project", id: projectId, fetch: (id) => api.getProject(id), normalize: (raw) => ({ ...raw, id: String(raw.id) }),}); Copy
const { data, isLoading, refetch } = useEntity({ type: "Project", id: projectId, fetch: (id) => api.getProject(id), normalize: (raw) => ({ ...raw, id: String(raw.id) }),});
Subscribe to a single normalized entity: populates the graph via
fetch/normalize, dedupes in-flight work, and revalidates when stale. Solves “query-owned silos” by keeping one canonical record every list/detail reads through.