Files
twenty/front/src/modules/comments/services/select.ts
T
Lucas BordeauandGitHub d28a762661 Finished relation picker for companies (#305)
* Finished relation picker for companies

* Minor fixes
2023-06-15 16:53:59 +02:00

59 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 {
id
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
}
}
}
`;