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

Function generateCommentsQueryKey

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

Source from the content-addressed store, hash-verified

623}
624
625export const generateCommentsQueryKey = ({
626 postId,
627 sortBy,
628}: GenerateCommentsQueryKeyProps): QueryKeyReturnType =>
629 generateQueryKey(
630 RequestKey.PostComments,
631 undefined,
632 // Filter out undefined to ensure key matches after JSON serialization
633 Object.fromEntries(
634 Object.entries({ postId, sortBy }).filter(([, v]) => v !== undefined),
635 ),
636 );
637
638export const getAllCommentsQuery = (postId: string): QueryKeyReturnType[] => {
639 const sorting = Object.values(SortCommentsBy).map((sortBy) =>

Callers 3

usePostCommentsFunction · 0.90
CompanionDiscussionFunction · 0.90
getAllCommentsQueryFunction · 0.85

Calls 1

generateQueryKeyFunction · 0.85

Tested by

no test coverage detected