MCPcopy Create free account
hub / github.com/getsentry/sentry / _apiOptionsInfinite

Function _apiOptionsInfinite

static/app/utils/api/apiOptions.ts:84–110  ·  view source on GitHub ↗
(
  path: TApiPath,
  ...[
    {staleTime, path: pathParams, ...options},
  ]: ExtractPathParams<TApiPath> extends never
    ? [Options & {path?: never}]
    : [Options & PathParamOptions<TApiPath>]
)

Source from the content-addressed store, hash-verified

82}
83
84function _apiOptionsInfinite<
85 // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-parameters
86 TManualData = never,
87 TApiPath extends KnownApiUrls = KnownApiUrls,
88 // todo: infer the actual data type from the ApiMapping
89 TActualData = TManualData,
90>(
91 path: TApiPath,
92 ...[
93 {staleTime, path: pathParams, ...options},
94 ]: ExtractPathParams<TApiPath> extends never
95 ? [Options & {path?: never}]
96 : [Options & PathParamOptions<TApiPath>]
97) {
98 const url = getApiUrl(path, ...([{path: pathParams}] as OptionalPathParams<TApiPath>));
99 const strippedOptions = stripUndefinedValues(options);
100
101 return infiniteQueryOptions({
102 queryKey: [url, strippedOptions, {infinite: true}] as const,
103 queryFn: pathParams === skipToken ? skipToken : apiFetchInfinite<TActualData>,
104 getPreviousPageParam: parsePageParam('previous'),
105 getNextPageParam: parsePageParam('next'),
106 initialPageParam: undefined,
107 enabled: pathParams !== skipToken,
108 staleTime,
109 });
110}
111
112/**
113 * Type-safe factory for TanStack Query options that hit Sentry API endpoints.

Callers 1

apiOptions.tsFile · 0.85

Calls 3

getApiUrlFunction · 0.90
stripUndefinedValuesFunction · 0.85
parsePageParamFunction · 0.70

Tested by

no test coverage detected