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

Function sourceImageQueryOptions

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

Source from the content-addressed store, hash-verified

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

Callers 2

SidebarEntityIconFunction · 0.90
RecentItemIconFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected