MCPcopy Create free account
hub / github.com/dailydotdev/apps / sourceImageQueryOptions

Function sourceImageQueryOptions

packages/shared/src/graphql/sources.ts:306–325  ·  view source on GitHub ↗
({
  handle,
  enabled,
}: {
  handle: string;
  enabled: boolean;
})

Source from the content-addressed store, hash-verified

304`;
305
306export 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
327export const sourceQueryOptions = ({ sourceId }: { sourceId: string }) => {
328 return {

Callers 2

SidebarEntityIconFunction · 0.90
RecentItemIconFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected