({
handle,
enabled,
}: {
handle: string;
enabled: boolean;
})
| 304 | `; |
| 305 | |
| 306 | export const sourceImageQueryOptions = ({ |
| 307 | handle, |
| 308 | enabled, |
| 309 | }: { |
| 310 | handle: string; |
| 311 | enabled: boolean; |
| 312 | }) => { |
| 313 | return { |
| 314 | queryKey: [RequestKey.Source, null, handle, 'image'], |
| 315 | queryFn: async () => { |
| 316 | const res = await gqlBatchRequest<{ |
| 317 | source: Pick<Source, 'id' | 'handle' | 'image'>; |
| 318 | }>(SOURCE_IMAGE_QUERY, { id: handle }); |
| 319 | |
| 320 | return res.source; |
| 321 | }, |
| 322 | staleTime: StaleTime.OneHour, |
| 323 | enabled: enabled && !!handle, |
| 324 | }; |
| 325 | }; |
| 326 | |
| 327 | export const sourceQueryOptions = ({ sourceId }: { sourceId: string }) => { |
| 328 | return { |
no outgoing calls
no test coverage detected