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

Function generateCommentsQueryKey

packages/shared/src/lib/query.ts:614–625  ·  view source on GitHub ↗
({
  postId,
  sortBy,
}: GenerateCommentsQueryKeyProps)

Source from the content-addressed store, hash-verified

612}
613
614export const generateCommentsQueryKey = ({
615 postId,
616 sortBy,
617}: GenerateCommentsQueryKeyProps): QueryKeyReturnType =>
618 generateQueryKey(
619 RequestKey.PostComments,
620 undefined,
621 // Filter out undefined to ensure key matches after JSON serialization
622 Object.fromEntries(
623 Object.entries({ postId, sortBy }).filter(([, v]) => v !== undefined),
624 ),
625 );
626
627export const getAllCommentsQuery = (postId: string): QueryKeyReturnType[] => {
628 const sorting = Object.values(SortCommentsBy).map((sortBy) =>

Callers 3

PostCommentsFunction · 0.90
CompanionDiscussionFunction · 0.90
getAllCommentsQueryFunction · 0.85

Calls 1

generateQueryKeyFunction · 0.85

Tested by

no test coverage detected