2020-02-18 07:57:00 +00:00
|
|
|
import gql from "graphql-tag";
|
2021-10-29 08:54:35 +00:00
|
|
|
import { ACTOR_FRAGMENT } from "./actor";
|
2018-11-06 09:30:27 +00:00
|
|
|
|
|
|
|
export const CREATE_USER = gql`
|
2020-02-18 07:57:00 +00:00
|
|
|
mutation CreateUser($email: String!, $password: String!, $locale: String) {
|
|
|
|
createUser(email: $email, password: $password, locale: $locale) {
|
|
|
|
email
|
|
|
|
confirmationSentAt
|
|
|
|
}
|
2018-11-06 09:30:27 +00:00
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
|
|
|
export const VALIDATE_USER = gql`
|
2020-02-18 07:57:00 +00:00
|
|
|
mutation ValidateUser($token: String!) {
|
|
|
|
validateUser(token: $token) {
|
|
|
|
accessToken
|
|
|
|
refreshToken
|
|
|
|
user {
|
|
|
|
id
|
|
|
|
email
|
|
|
|
defaultActor {
|
2021-10-29 08:54:35 +00:00
|
|
|
...ActorFragment
|
2019-10-07 11:47:46 +00:00
|
|
|
}
|
2019-01-30 14:54:21 +00:00
|
|
|
}
|
2018-11-06 09:30:27 +00:00
|
|
|
}
|
|
|
|
}
|
2021-10-29 08:54:35 +00:00
|
|
|
${ACTOR_FRAGMENT}
|
2018-11-06 09:30:27 +00:00
|
|
|
`;
|
2019-01-18 13:47:10 +00:00
|
|
|
|
2020-02-13 14:48:12 +00:00
|
|
|
export const LOGGED_USER = gql`
|
|
|
|
query {
|
|
|
|
loggedUser {
|
2020-02-18 07:57:00 +00:00
|
|
|
id
|
2020-02-13 14:48:12 +00:00
|
|
|
email
|
2020-06-27 17:12:45 +00:00
|
|
|
defaultActor {
|
2021-10-29 08:54:35 +00:00
|
|
|
...ActorFragment
|
2020-06-27 17:12:45 +00:00
|
|
|
}
|
|
|
|
provider
|
2020-02-13 14:48:12 +00:00
|
|
|
}
|
|
|
|
}
|
2021-10-29 08:54:35 +00:00
|
|
|
${ACTOR_FRAGMENT}
|
2020-02-13 14:48:12 +00:00
|
|
|
`;
|
|
|
|
|
2019-09-24 16:47:35 +00:00
|
|
|
export const CHANGE_PASSWORD = gql`
|
|
|
|
mutation ChangePassword($oldPassword: String!, $newPassword: String!) {
|
|
|
|
changePassword(oldPassword: $oldPassword, newPassword: $newPassword) {
|
|
|
|
id
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
2020-02-13 14:48:12 +00:00
|
|
|
export const CHANGE_EMAIL = gql`
|
|
|
|
mutation ChangeEmail($email: String!, $password: String!) {
|
|
|
|
changeEmail(email: $email, password: $password) {
|
|
|
|
id
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
|
|
|
export const VALIDATE_EMAIL = gql`
|
|
|
|
mutation ValidateEmail($token: String!) {
|
2020-02-18 07:57:00 +00:00
|
|
|
validateEmail(token: $token) {
|
2020-02-13 14:48:12 +00:00
|
|
|
id
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
|
|
|
export const DELETE_ACCOUNT = gql`
|
2020-06-27 17:12:45 +00:00
|
|
|
mutation DeleteAccount($password: String, $userId: ID) {
|
2020-06-11 17:13:21 +00:00
|
|
|
deleteAccount(password: $password, userId: $userId) {
|
2020-02-13 14:48:12 +00:00
|
|
|
id
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
2020-08-18 15:21:58 +00:00
|
|
|
export const SUSPEND_USER = gql`
|
|
|
|
mutation SuspendUser($userId: ID) {
|
|
|
|
deleteAccount(userId: $userId) {
|
|
|
|
id
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
2019-01-18 13:47:10 +00:00
|
|
|
export const CURRENT_USER_CLIENT = gql`
|
2021-05-17 16:19:24 +00:00
|
|
|
query CurrentUserClient {
|
2020-02-18 07:57:00 +00:00
|
|
|
currentUser @client {
|
|
|
|
id
|
|
|
|
email
|
|
|
|
isLoggedIn
|
|
|
|
role
|
|
|
|
}
|
2019-01-18 13:47:10 +00:00
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
|
|
|
export const UPDATE_CURRENT_USER_CLIENT = gql`
|
2020-02-18 07:57:00 +00:00
|
|
|
mutation UpdateCurrentUser(
|
|
|
|
$id: String!
|
|
|
|
$email: String!
|
|
|
|
$isLoggedIn: Boolean!
|
|
|
|
$role: UserRole!
|
|
|
|
) {
|
2020-11-30 09:24:11 +00:00
|
|
|
updateCurrentUser(
|
|
|
|
id: $id
|
|
|
|
email: $email
|
|
|
|
isLoggedIn: $isLoggedIn
|
|
|
|
role: $role
|
|
|
|
) @client
|
2020-02-18 07:57:00 +00:00
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
|
|
|
export const USER_SETTINGS_FRAGMENT = gql`
|
|
|
|
fragment UserSettingFragment on UserSettings {
|
|
|
|
timezone
|
|
|
|
notificationOnDay
|
|
|
|
notificationEachWeek
|
|
|
|
notificationBeforeEvent
|
2020-06-08 10:28:19 +00:00
|
|
|
notificationPendingParticipation
|
2020-11-06 10:34:32 +00:00
|
|
|
notificationPendingMembership
|
2021-06-26 13:23:22 +00:00
|
|
|
groupNotifications
|
2021-02-12 17:19:49 +00:00
|
|
|
location {
|
|
|
|
range
|
|
|
|
geohash
|
|
|
|
name
|
|
|
|
}
|
2020-02-18 07:57:00 +00:00
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
|
|
|
export const USER_SETTINGS = gql`
|
|
|
|
query UserSetting {
|
|
|
|
loggedUser {
|
2020-06-25 09:36:35 +00:00
|
|
|
id
|
2020-06-16 16:00:27 +00:00
|
|
|
locale
|
2020-02-18 07:57:00 +00:00
|
|
|
settings {
|
|
|
|
...UserSettingFragment
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
${USER_SETTINGS_FRAGMENT}
|
|
|
|
`;
|
|
|
|
|
2021-10-10 14:25:50 +00:00
|
|
|
export const LOGGED_USER_TIMEZONE = gql`
|
|
|
|
query LoggedUserTimezone {
|
|
|
|
loggedUser {
|
|
|
|
id
|
|
|
|
settings {
|
|
|
|
timezone
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
2020-02-18 07:57:00 +00:00
|
|
|
export const SET_USER_SETTINGS = gql`
|
|
|
|
mutation SetUserSettings(
|
|
|
|
$timezone: String
|
|
|
|
$notificationOnDay: Boolean
|
|
|
|
$notificationEachWeek: Boolean
|
|
|
|
$notificationBeforeEvent: Boolean
|
2020-11-06 10:34:32 +00:00
|
|
|
$notificationPendingParticipation: NotificationPendingEnum
|
|
|
|
$notificationPendingMembership: NotificationPendingEnum
|
2021-06-26 13:23:22 +00:00
|
|
|
$groupNotifications: NotificationPendingEnum
|
2021-02-12 17:19:49 +00:00
|
|
|
$location: LocationInput
|
2020-02-18 07:57:00 +00:00
|
|
|
) {
|
|
|
|
setUserSettings(
|
|
|
|
timezone: $timezone
|
|
|
|
notificationOnDay: $notificationOnDay
|
|
|
|
notificationEachWeek: $notificationEachWeek
|
|
|
|
notificationBeforeEvent: $notificationBeforeEvent
|
2020-06-08 10:28:19 +00:00
|
|
|
notificationPendingParticipation: $notificationPendingParticipation
|
2020-11-06 10:34:32 +00:00
|
|
|
notificationPendingMembership: $notificationPendingMembership
|
2021-06-26 13:23:22 +00:00
|
|
|
groupNotifications: $groupNotifications
|
2021-02-12 17:19:49 +00:00
|
|
|
location: $location
|
2020-02-18 07:57:00 +00:00
|
|
|
) {
|
|
|
|
...UserSettingFragment
|
|
|
|
}
|
|
|
|
}
|
|
|
|
${USER_SETTINGS_FRAGMENT}
|
2019-01-30 14:54:21 +00:00
|
|
|
`;
|
2020-06-11 17:13:21 +00:00
|
|
|
|
2021-06-01 16:08:03 +00:00
|
|
|
export const USER_NOTIFICATIONS = gql`
|
|
|
|
query UserNotifications {
|
|
|
|
loggedUser {
|
|
|
|
id
|
|
|
|
locale
|
|
|
|
settings {
|
|
|
|
...UserSettingFragment
|
|
|
|
}
|
|
|
|
activitySettings {
|
|
|
|
key
|
|
|
|
method
|
|
|
|
enabled
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
${USER_SETTINGS_FRAGMENT}
|
|
|
|
`;
|
|
|
|
|
|
|
|
export const UPDATE_ACTIVITY_SETTING = gql`
|
|
|
|
mutation UpdateActivitySetting(
|
|
|
|
$key: String!
|
|
|
|
$method: String!
|
|
|
|
$enabled: Boolean!
|
|
|
|
) {
|
|
|
|
updateActivitySetting(key: $key, method: $method, enabled: $enabled) {
|
|
|
|
key
|
|
|
|
method
|
|
|
|
enabled
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
2020-06-11 17:13:21 +00:00
|
|
|
export const LIST_USERS = gql`
|
|
|
|
query ListUsers($email: String, $page: Int, $limit: Int) {
|
|
|
|
users(email: $email, page: $page, limit: $limit) {
|
|
|
|
total
|
|
|
|
elements {
|
|
|
|
id
|
|
|
|
email
|
|
|
|
locale
|
|
|
|
confirmedAt
|
|
|
|
disabled
|
|
|
|
actors {
|
2021-10-29 08:54:35 +00:00
|
|
|
...ActorFragment
|
2020-06-11 17:13:21 +00:00
|
|
|
}
|
|
|
|
settings {
|
|
|
|
timezone
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2021-10-29 08:54:35 +00:00
|
|
|
${ACTOR_FRAGMENT}
|
2020-06-11 17:13:21 +00:00
|
|
|
`;
|
|
|
|
|
|
|
|
export const GET_USER = gql`
|
|
|
|
query GetUser($id: ID!) {
|
|
|
|
user(id: $id) {
|
|
|
|
id
|
|
|
|
email
|
|
|
|
confirmedAt
|
|
|
|
confirmationSentAt
|
2020-08-31 14:57:13 +00:00
|
|
|
lastSignInAt
|
|
|
|
lastSignInIp
|
|
|
|
currentSignInIp
|
|
|
|
currentSignInAt
|
2020-06-11 17:13:21 +00:00
|
|
|
locale
|
|
|
|
disabled
|
2020-11-23 15:58:50 +00:00
|
|
|
mediaSize
|
2020-06-11 17:13:21 +00:00
|
|
|
defaultActor {
|
|
|
|
id
|
|
|
|
}
|
|
|
|
actors {
|
2021-10-29 08:54:35 +00:00
|
|
|
...ActorFragment
|
2020-06-11 17:13:21 +00:00
|
|
|
}
|
|
|
|
participations {
|
|
|
|
total
|
|
|
|
}
|
|
|
|
role
|
|
|
|
}
|
|
|
|
}
|
2021-10-29 08:54:35 +00:00
|
|
|
${ACTOR_FRAGMENT}
|
2020-06-11 17:13:21 +00:00
|
|
|
`;
|
2020-06-16 16:00:27 +00:00
|
|
|
|
|
|
|
export const UPDATE_USER_LOCALE = gql`
|
|
|
|
mutation UpdateUserLocale($locale: String!) {
|
|
|
|
updateLocale(locale: $locale) {
|
|
|
|
id
|
|
|
|
locale
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|
2021-03-26 18:01:55 +00:00
|
|
|
|
|
|
|
export const FEED_TOKENS_LOGGED_USER = gql`
|
|
|
|
query {
|
|
|
|
loggedUser {
|
|
|
|
id
|
|
|
|
feedTokens {
|
|
|
|
token
|
|
|
|
actor {
|
|
|
|
id
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|