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

Function picksSuggestionsQueryOptions

packages/shared/src/graphql/picks.ts:280–297  ·  view source on GitHub ↗
(
  user?: Pick<LoggedUser, 'id'>,
  fromPicksId?: string,
)

Source from the content-addressed store, hash-verified

278});
279
280export const picksSuggestionsQueryOptions = (
281 user?: Pick<LoggedUser, 'id'>,
282 fromPicksId?: string,
283) => ({
284 queryKey: generateQueryKey(
285 RequestKey.Picks,
286 user,
287 'suggestions',
288 fromPicksId ?? null,
289 ),
290 queryFn: async (): Promise<PicksSuggestion[]> => {
291 const data = await gqlClient.request<{
292 picksSuggestions: PicksSuggestion[];
293 }>(PICKS_SUGGESTIONS_QUERY, fromPicksId ? { fromPicksId } : undefined);
294 return data.picksSuggestions ?? [];
295 },
296 enabled: !!user?.id,
297});
298
299export const upsertPicks = async (
300 items: PicksItemInput[],

Callers 1

usePicksEditorFunction · 0.90

Calls 1

generateQueryKeyFunction · 0.90

Tested by

no test coverage detected