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

Function generateCommentsQueryKey

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

Source from the content-addressed store, hash-verified

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