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,11 @@
|
||||
import { gql } from '@apollo/client';
|
||||
|
||||
export const USER_FIELDS_FRAGMENT = gql`
|
||||
fragment userFieldsFragment on User {
|
||||
id
|
||||
email
|
||||
displayName
|
||||
firstName
|
||||
lastName
|
||||
}
|
||||
`;
|
||||
@ -3,50 +3,11 @@ import { gql } from '@apollo/client';
|
||||
export const GET_CURRENT_USER = gql`
|
||||
query GetCurrentUser {
|
||||
currentUser {
|
||||
id
|
||||
email
|
||||
displayName
|
||||
firstName
|
||||
lastName
|
||||
...userFieldsFragment
|
||||
avatarUrl
|
||||
canImpersonate
|
||||
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
|
||||
}
|
||||
...workspaceMemberFieldsFragment
|
||||
}
|
||||
settings {
|
||||
id
|
||||
|
||||
@ -3,11 +3,7 @@ import { gql } from '@apollo/client';
|
||||
export const GET_USERS = gql`
|
||||
query GetUsers {
|
||||
findManyUser {
|
||||
id
|
||||
email
|
||||
displayName
|
||||
firstName
|
||||
lastName
|
||||
...userFieldsFragment
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
Reference in New Issue
Block a user