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

Function generateCommentsQueryKey

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

Source from the content-addressed store, hash-verified

588}
589
590export const generateCommentsQueryKey = ({
591 postId,
592 sortBy,
593}: GenerateCommentsQueryKeyProps): QueryKeyReturnType =>
594 generateQueryKey(
595 RequestKey.PostComments,
596 undefined,
597 // Filter out undefined to ensure key matches after JSON serialization
598 Object.fromEntries(
599 Object.entries({ postId, sortBy }).filter(([, v]) => v !== undefined),
600 ),
601 );
602
603export const getAllCommentsQuery = (postId: string): QueryKeyReturnType[] => {
604 const sorting = Object.values(SortCommentsBy).map((sortBy) =>

Callers 5

seedFunction · 0.90
usePostCommentsFunction · 0.90
CompanionDiscussionFunction · 0.90
getAllCommentsQueryFunction · 0.85

Calls 1

generateQueryKeyFunction · 0.85

Tested by

no test coverage detected