ed1662223a
* Add company and person on update and create * Enable reading with error management on commentable ID * [CHECKPOINT] backward-compatible * Migrate data for activity targets * Revert "Migrate data for activity targets" This reverts commit f89bc30689655c83cd5370331fec41b59d03fdb9. --------- Co-authored-by: Charles Bochet <charles@twenty.com>
90 lines
1.8 KiB
TypeScript
90 lines
1.8 KiB
TypeScript
import { gql } from '@apollo/client';
|
|
|
|
export const ADD_ACTIVITY_TARGETS = gql`
|
|
mutation AddActivityTargetsOnActivity(
|
|
$activityId: String!
|
|
$activityTargetInputs: [ActivityTargetCreateManyActivityInput!]!
|
|
) {
|
|
updateOneActivity(
|
|
where: { id: $activityId }
|
|
data: { activityTargets: { createMany: { data: $activityTargetInputs } } }
|
|
) {
|
|
id
|
|
createdAt
|
|
updatedAt
|
|
activityTargets {
|
|
id
|
|
createdAt
|
|
updatedAt
|
|
commentableType
|
|
commentableId
|
|
companyId
|
|
personId
|
|
}
|
|
}
|
|
}
|
|
`;
|
|
|
|
export const REMOVE_ACTIVITY_TARGETS = gql`
|
|
mutation RemoveActivityTargetsOnActivity(
|
|
$activityId: String!
|
|
$activityTargetIds: [String!]!
|
|
) {
|
|
updateOneActivity(
|
|
where: { id: $activityId }
|
|
data: {
|
|
activityTargets: { deleteMany: { id: { in: $activityTargetIds } } }
|
|
}
|
|
) {
|
|
id
|
|
createdAt
|
|
updatedAt
|
|
activityTargets {
|
|
id
|
|
createdAt
|
|
updatedAt
|
|
commentableType
|
|
commentableId
|
|
companyId
|
|
personId
|
|
}
|
|
}
|
|
}
|
|
`;
|
|
|
|
export const DELETE_ACTIVITY = gql`
|
|
mutation DeleteActivity($activityId: String!) {
|
|
deleteManyActivities(where: { id: { equals: $activityId } }) {
|
|
count
|
|
}
|
|
}
|
|
`;
|
|
|
|
export const UPDATE_ACTIVITY = gql`
|
|
mutation UpdateActivity(
|
|
$where: ActivityWhereUniqueInput!
|
|
$data: ActivityUpdateInput!
|
|
) {
|
|
updateOneActivity(where: $where, data: $data) {
|
|
id
|
|
body
|
|
title
|
|
type
|
|
completedAt
|
|
dueAt
|
|
assignee {
|
|
id
|
|
firstName
|
|
lastName
|
|
displayName
|
|
}
|
|
}
|
|
}
|
|
`;
|
|
|
|
export const UPLOAD_ATTACHMENT = gql`
|
|
mutation UploadAttachment($file: Upload!, $activityId: String!) {
|
|
uploadAttachment(file: $file, activityId: $activityId)
|
|
}
|
|
`;
|