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

Function generateCommentsQueryKey

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

Source from the content-addressed store, hash-verified

610}
611
612export const generateCommentsQueryKey = ({
613 postId,
614 sortBy,
615}: GenerateCommentsQueryKeyProps): QueryKeyReturnType =>
616 generateQueryKey(
617 RequestKey.PostComments,
618 undefined,
619 // Filter out undefined to ensure key matches after JSON serialization
620 Object.fromEntries(
621 Object.entries({ postId, sortBy }).filter(([, v]) => v !== undefined),
622 ),
623 );
624
625export const getAllCommentsQuery = (postId: string): QueryKeyReturnType[] => {
626 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