Chore: Use Fragments as types (#1670)
* Use Fragments as types Co-authored-by: v1b3m <vibenjamin6@gmail.com> * Use Fragments as types in GraphQL queries and mutations Co-authored-by: v1b3m <vibenjamin6@gmail.com> --------- Co-authored-by: v1b3m <vibenjamin6@gmail.com>
This commit is contained in:
@ -0,0 +1,16 @@
|
||||
import { gql } from '@apollo/client';
|
||||
|
||||
export const ACTIVITY_WITH_TARGETS = gql`
|
||||
fragment ActivityWithTargets on Activity {
|
||||
id
|
||||
createdAt
|
||||
updatedAt
|
||||
activityTargets {
|
||||
id
|
||||
createdAt
|
||||
updatedAt
|
||||
companyId
|
||||
personId
|
||||
}
|
||||
}
|
||||
`;
|
||||
@ -9,16 +9,7 @@ export const ADD_ACTIVITY_TARGETS = gql`
|
||||
where: { id: $activityId }
|
||||
data: { activityTargets: { createMany: { data: $activityTargetInputs } } }
|
||||
) {
|
||||
id
|
||||
createdAt
|
||||
updatedAt
|
||||
activityTargets {
|
||||
id
|
||||
createdAt
|
||||
updatedAt
|
||||
companyId
|
||||
personId
|
||||
}
|
||||
...ActivityWithTargets
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
@ -11,16 +11,7 @@ export const REMOVE_ACTIVITY_TARGETS = gql`
|
||||
activityTargets: { deleteMany: { id: { in: $activityTargetIds } } }
|
||||
}
|
||||
) {
|
||||
id
|
||||
createdAt
|
||||
updatedAt
|
||||
activityTargets {
|
||||
id
|
||||
createdAt
|
||||
updatedAt
|
||||
companyId
|
||||
personId
|
||||
}
|
||||
...ActivityWithTargets
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
Reference in New Issue
Block a user