Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/openstatusHQ/openstatus. ๐ซ Status page with uptime monitoring & API monitoring as code ๐ซ openstatus.dev
bun drizzle-orm monitoring monitoring-as-code nextjs observability on-call open-source shadcn-ui status-page statuspage synthetic-monitoring tinybird turso uptime uptime-checker uptime-monitor
Something went wrong. Try again.
785 B ยท 30 lines
TypeScript
12345678910111213141516171819202122232425262728293031import * as Sentry from "@sentry/nextjs";import { QueryCache, QueryClient, defaultShouldDehydrateQuery,} from "@tanstack/react-query";
export function makeQueryClient() { return new QueryClient({ // `prefetchQuery` swallows rejections, so the cache is the only place left // to observe a failed server-side prefetch. queryCache: new QueryCache({ onError: (error, query) => Sentry.captureException(error, { extra: { queryHash: query.queryHash }, }), }), defaultOptions: { queries: { staleTime: 60 * 1000, }, dehydrate: { shouldDehydrateQuery: (query) => defaultShouldDehydrateQuery(query) || query.state.status === "pending", }, hydrate: {}, }, });}