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

Function sourceImageQueryOptions

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

Source from the content-addressed store, hash-verified

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

Callers 2

SidebarEntityIconFunction · 0.90
RecentItemIconFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected