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

Function sourceMutedAuthorsQueryOptions

packages/shared/src/graphql/squads.ts:1606–1624  ·  view source on GitHub ↗
({
  sourceId,
  user,
}: {
  sourceId?: string;
  user?: Pick<LoggedUser, 'id'>;
})

Source from the content-addressed store, hash-verified

1604`;
1605
1606export const sourceMutedAuthorsQueryOptions = ({
1607 sourceId,
1608 user,
1609}: {
1610 sourceId?: string;
1611 user?: Pick<LoggedUser, 'id'>;
1612}) =>
1613 infiniteQueryOptions({
1614 queryKey: generateQueryKey(RequestKey.SquadMutedAuthors, user, sourceId),
1615 queryFn: ({ pageParam }) =>
1616 gqlClient
1617 .request<{
1618 sourceMutedAuthors: Connection<SourceMutedAuthor>;
1619 }>(SOURCE_MUTED_AUTHORS_QUERY, { sourceId, after: pageParam })
1620 .then((res) => res.sourceMutedAuthors),
1621 initialPageParam: '',
1622 getNextPageParam: (page) => getNextPageParam(page?.pageInfo),
1623 enabled: !!user && !!sourceId,
1624 });

Callers 1

SquadMutedAuthorsListFunction · 0.90

Calls 2

generateQueryKeyFunction · 0.90
getNextPageParamFunction · 0.90

Tested by

no test coverage detected