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,42 @@
|
||||
import { gql } from '@apollo/client';
|
||||
|
||||
export const WORKSPACE_MEMBER_FIELDS_FRAGMENT = gql`
|
||||
fragment workspaceMemberFieldsFragment on WorkspaceMember {
|
||||
id
|
||||
allowImpersonation
|
||||
workspace {
|
||||
id
|
||||
domainName
|
||||
displayName
|
||||
logo
|
||||
inviteHash
|
||||
}
|
||||
assignedActivities {
|
||||
id
|
||||
title
|
||||
}
|
||||
authoredActivities {
|
||||
id
|
||||
title
|
||||
}
|
||||
authoredAttachments {
|
||||
id
|
||||
name
|
||||
type
|
||||
}
|
||||
settings {
|
||||
id
|
||||
colorScheme
|
||||
locale
|
||||
}
|
||||
companies {
|
||||
id
|
||||
name
|
||||
domainName
|
||||
}
|
||||
comments {
|
||||
id
|
||||
body
|
||||
}
|
||||
}
|
||||
`;
|
||||
@ -6,42 +6,7 @@ export const UPDATE_WORKSPACE_MEMBER = gql`
|
||||
$where: WorkspaceMemberWhereUniqueInput!
|
||||
) {
|
||||
UpdateOneWorkspaceMember(data: $data, where: $where) {
|
||||
id
|
||||
allowImpersonation
|
||||
workspace {
|
||||
id
|
||||
domainName
|
||||
displayName
|
||||
logo
|
||||
inviteHash
|
||||
}
|
||||
assignedActivities {
|
||||
id
|
||||
title
|
||||
}
|
||||
authoredActivities {
|
||||
id
|
||||
title
|
||||
}
|
||||
authoredAttachments {
|
||||
id
|
||||
name
|
||||
type
|
||||
}
|
||||
settings {
|
||||
id
|
||||
colorScheme
|
||||
locale
|
||||
}
|
||||
companies {
|
||||
id
|
||||
name
|
||||
domainName
|
||||
}
|
||||
comments {
|
||||
id
|
||||
body
|
||||
}
|
||||
...workspaceMemberFieldsFragment
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
@ -5,12 +5,8 @@ export const GET_WORKSPACE_MEMBERS = gql`
|
||||
workspaceMembers: findManyWorkspaceMember(where: $where) {
|
||||
id
|
||||
user {
|
||||
id
|
||||
email
|
||||
...userFieldsFragment
|
||||
avatarUrl
|
||||
firstName
|
||||
lastName
|
||||
displayName
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user