Files
twenty/front/src/modules/comments/services/select.ts
T
fdfb6f10e2 Implemented comment thread target picker with new dropdown components (#295)
* First draft of new relation picker and usage in comments
---------

Co-authored-by: Charles Bochet <charles@twenty.com>
2023-06-14 18:48:26 +02:00

58 lines
1.1 KiB
TypeScript

import { gql } from '@apollo/client';
export const GET_COMMENT_THREADS_BY_TARGETS = gql`
query GetCommentThreadsByTargets(
$commentThreadTargetIds: [String!]!
$orderBy: [CommentThreadOrderByWithRelationInput!]
) {
findManyCommentThreads(
orderBy: $orderBy
where: {
commentThreadTargets: {
some: { commentableId: { in: $commentThreadTargetIds } }
}
}
) {
id
comments {
id
body
createdAt
updatedAt
author {
id
displayName
avatarUrl
}
}
commentThreadTargets {
commentableId
commentableType
}
}
}
`;
export const GET_COMMENT_THREAD = gql`
query GetCommentThread($commentThreadId: String!) {
findManyCommentThreads(where: { id: { equals: $commentThreadId } }) {
id
comments {
id
body
createdAt
updatedAt
author {
id
displayName
avatarUrl
}
}
commentThreadTargets {
commentableId
commentableType
}
}
}
`;