ref(tsc): move event-timeseries endpoint to apiOptions#113883
Conversation
| if (!q?.data) { | ||
| return; | ||
| } | ||
|
|
||
| const responseData = q.data[0]; | ||
| const responseData = q.data; |
There was a problem hiding this comment.
Is this related to type inference, or why do we no longer check for the 0th index truthyness?
There was a problem hiding this comment.
the result of q.data used to come directly from fetchDataQuery, which returned:
Lines 52 to 56 in 8a4f150
[0] was the actual data. Now that we use apiOptions, we internally select .json out of it if no select is specified:
sentry/static/app/utils/api/apiOptions.ts
Line 75 in c0479af
sentry/static/app/utils/api/apiOptions.ts
Line 44 in c0479af
so q.data is our data, same as q.data[0] was before.
| enabled: enabled && (hasCustomPageFilters ? true : arePageFiltersReady), | ||
| ...options.queryOptions, |
There was a problem hiding this comment.
We have got 2x enabled props here (top-level enabled and queryOptions.enabled), and the spread order means queryOptions.enabled overwrites the arePageFiltersReady gate. Not introduced by this PR, but worth a follow-up: probably best to drop one of them
There was a problem hiding this comment.
yes I was confused about this as well 🫠
No description provided.