Zum Inhalt springen
Kitbay

frontend-data-fetching

NOASSERTIONAktualisiert am 11. Nov. 202645.751GitHub-Sterne

A maintainer skill in Sentry's own repository for how React code in its frontend calls the Sentry API, using TanStack Query with Sentry's apiOptions helper.

Was der Skill vermittelt

A maintainer skill in Sentry's own repository for how React code in its frontend calls the Sentry API, using TanStack Query with Sentry's apiOptions helper. It lists the approved helpers for queries, mutations, conditional queries and manual fetches, and marks older helpers as deprecated. Rules require an explicit stale time, reusable abstractions built on the options object rather than on hooks, letting TypeScript infer types instead of passing generics, typing mutation inputs rather than hook generics, and treating errors as plain Error narrowed at runtime. It also explains that the cache holds both JSON and headers and how to read pagination and hit-count headers with a select helper.

Funktionen

  • Write queries and mutations with apiOptions
  • Disable a query conditionally
  • Read pagination and hit-count headers
  • Avoid deprecated query helpers