2018-11-06 09:30:27 +00:00
|
|
|
import gql from 'graphql-tag';
|
|
|
|
|
2019-01-21 14:08:22 +00:00
|
|
|
export const FETCH_PERSON = gql`
|
2019-10-04 16:28:25 +00:00
|
|
|
query($username: String!) {
|
|
|
|
fetchPerson(preferredUsername: $username) {
|
2019-03-21 19:23:42 +00:00
|
|
|
id,
|
2018-11-06 09:30:27 +00:00
|
|
|
url,
|
|
|
|
name,
|
|
|
|
domain,
|
|
|
|
summary,
|
|
|
|
preferredUsername,
|
|
|
|
suspended,
|
2019-05-22 12:12:11 +00:00
|
|
|
avatar {
|
2019-06-17 15:15:27 +00:00
|
|
|
name,
|
2019-05-22 12:12:11 +00:00
|
|
|
url
|
|
|
|
},
|
|
|
|
banner {
|
|
|
|
url
|
|
|
|
},
|
2019-03-21 19:23:42 +00:00
|
|
|
feedTokens {
|
|
|
|
token
|
|
|
|
},
|
2018-11-06 09:30:27 +00:00
|
|
|
organizedEvents {
|
|
|
|
uuid,
|
2019-03-21 19:23:42 +00:00
|
|
|
title,
|
|
|
|
beginsOn
|
2018-11-06 09:30:27 +00:00
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
2019-10-04 16:28:25 +00:00
|
|
|
export const GET_PERSON = gql`
|
|
|
|
query($actorId: ID!) {
|
|
|
|
person(id: $actorId) {
|
|
|
|
id,
|
|
|
|
url,
|
|
|
|
name,
|
|
|
|
domain,
|
|
|
|
summary,
|
|
|
|
preferredUsername,
|
|
|
|
suspended,
|
|
|
|
avatar {
|
|
|
|
name,
|
|
|
|
url
|
|
|
|
},
|
|
|
|
banner {
|
|
|
|
url
|
|
|
|
},
|
|
|
|
feedTokens {
|
|
|
|
token
|
|
|
|
},
|
|
|
|
organizedEvents {
|
|
|
|
uuid,
|
|
|
|
title,
|
|
|
|
beginsOn
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
2019-01-21 14:08:22 +00:00
|
|
|
export const LOGGED_PERSON = gql`
|
2018-11-06 09:30:27 +00:00
|
|
|
query {
|
2019-01-21 14:08:22 +00:00
|
|
|
loggedPerson {
|
|
|
|
id,
|
2019-05-22 12:12:11 +00:00
|
|
|
avatar {
|
|
|
|
url
|
|
|
|
},
|
2018-11-06 09:30:27 +00:00
|
|
|
preferredUsername,
|
|
|
|
}
|
|
|
|
}`;
|
2019-01-21 14:08:22 +00:00
|
|
|
|
2019-09-11 07:59:01 +00:00
|
|
|
export const CURRENT_ACTOR_CLIENT = gql`
|
2019-11-18 15:06:24 +00:00
|
|
|
query currentActor {
|
2019-09-11 07:59:01 +00:00
|
|
|
currentActor @client {
|
|
|
|
id,
|
|
|
|
avatar {
|
|
|
|
url
|
|
|
|
},
|
|
|
|
preferredUsername,
|
|
|
|
name
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
|
|
|
export const UPDATE_CURRENT_ACTOR_CLIENT = gql`
|
|
|
|
mutation UpdateCurrentActor($id: String!, $avatar: String, $preferredUsername: String!, $name: String!) {
|
|
|
|
updateCurrentActor(id: $id, avatar: $avatar, preferredUsername: $preferredUsername, name: $name) @client
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
2019-09-18 15:32:37 +00:00
|
|
|
export const LOGGED_USER_PARTICIPATIONS = gql`
|
2019-10-02 15:59:07 +00:00
|
|
|
query LoggedUserParticipations($afterDateTime: DateTime, $beforeDateTime: DateTime, $page: Int, $limit: Int) {
|
2019-09-18 15:32:37 +00:00
|
|
|
loggedUser {
|
|
|
|
participations(afterDatetime: $afterDateTime, beforeDatetime: $beforeDateTime, page: $page, limit: $limit) {
|
|
|
|
event {
|
|
|
|
id,
|
|
|
|
uuid,
|
|
|
|
title,
|
|
|
|
picture {
|
2019-10-07 14:48:13 +00:00
|
|
|
id,
|
2019-09-18 15:32:37 +00:00
|
|
|
url,
|
|
|
|
alt
|
|
|
|
},
|
|
|
|
beginsOn,
|
|
|
|
visibility,
|
|
|
|
organizerActor {
|
|
|
|
id,
|
|
|
|
preferredUsername,
|
|
|
|
name,
|
|
|
|
domain,
|
|
|
|
avatar {
|
|
|
|
url
|
|
|
|
}
|
|
|
|
},
|
|
|
|
participantStats {
|
2019-10-25 15:43:37 +00:00
|
|
|
notApproved
|
|
|
|
participant
|
2019-09-18 15:32:37 +00:00
|
|
|
},
|
|
|
|
options {
|
|
|
|
maximumAttendeeCapacity
|
|
|
|
remainingAttendeeCapacity
|
|
|
|
}
|
|
|
|
},
|
2019-09-20 16:22:03 +00:00
|
|
|
id,
|
2019-09-18 15:32:37 +00:00
|
|
|
role,
|
|
|
|
actor {
|
|
|
|
id,
|
|
|
|
preferredUsername,
|
|
|
|
name,
|
|
|
|
domain,
|
|
|
|
avatar {
|
|
|
|
url
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2019-03-21 19:23:42 +00:00
|
|
|
}
|
|
|
|
}`;
|
|
|
|
|
2019-10-02 15:59:07 +00:00
|
|
|
export const LOGGED_USER_DRAFTS = gql`
|
|
|
|
query LoggedUserDrafts($page: Int, $limit: Int) {
|
|
|
|
loggedUser {
|
|
|
|
drafts(page: $page, limit: $limit) {
|
|
|
|
id,
|
|
|
|
uuid,
|
|
|
|
title,
|
|
|
|
picture {
|
2019-10-07 14:48:13 +00:00
|
|
|
id,
|
2019-10-02 15:59:07 +00:00
|
|
|
url,
|
|
|
|
alt
|
|
|
|
},
|
|
|
|
beginsOn,
|
|
|
|
visibility,
|
|
|
|
organizerActor {
|
|
|
|
id,
|
|
|
|
preferredUsername,
|
|
|
|
name,
|
|
|
|
domain,
|
|
|
|
avatar {
|
|
|
|
url
|
|
|
|
}
|
|
|
|
},
|
|
|
|
participantStats {
|
2019-10-25 15:43:37 +00:00
|
|
|
going,
|
|
|
|
notApproved
|
2019-10-02 15:59:07 +00:00
|
|
|
},
|
|
|
|
options {
|
|
|
|
maximumAttendeeCapacity
|
|
|
|
remainingAttendeeCapacity
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}`;
|
|
|
|
|
2019-01-21 14:08:22 +00:00
|
|
|
export const IDENTITIES = gql`
|
|
|
|
query {
|
|
|
|
identities {
|
2019-06-17 15:15:27 +00:00
|
|
|
id,
|
2019-05-22 12:12:11 +00:00
|
|
|
avatar {
|
|
|
|
url
|
|
|
|
},
|
2019-01-21 14:08:22 +00:00
|
|
|
preferredUsername,
|
|
|
|
name
|
|
|
|
}
|
|
|
|
}`;
|
|
|
|
|
|
|
|
export const CREATE_PERSON = gql`
|
2019-06-17 15:15:27 +00:00
|
|
|
mutation CreatePerson($preferredUsername: String!, $name: String!, $summary: String, $avatar: PictureInput) {
|
2019-01-29 10:02:32 +00:00
|
|
|
createPerson(
|
|
|
|
preferredUsername: $preferredUsername,
|
|
|
|
name: $name,
|
2019-06-17 15:15:27 +00:00
|
|
|
summary: $summary,
|
|
|
|
avatar: $avatar
|
2019-01-29 10:02:32 +00:00
|
|
|
) {
|
2019-06-17 15:15:27 +00:00
|
|
|
id,
|
2019-01-21 14:08:22 +00:00
|
|
|
preferredUsername,
|
|
|
|
name,
|
2019-01-29 10:02:32 +00:00
|
|
|
summary,
|
2019-05-22 12:12:11 +00:00
|
|
|
avatar {
|
|
|
|
url
|
2019-06-17 15:15:27 +00:00
|
|
|
}
|
2019-01-21 14:08:22 +00:00
|
|
|
}
|
|
|
|
}
|
2019-01-29 10:02:32 +00:00
|
|
|
`;
|
|
|
|
|
2019-06-17 15:15:27 +00:00
|
|
|
export const UPDATE_PERSON = gql`
|
2019-10-04 16:28:25 +00:00
|
|
|
mutation UpdatePerson($id: ID!, $name: String, $summary: String, $avatar: PictureInput) {
|
2019-06-17 15:15:27 +00:00
|
|
|
updatePerson(
|
2019-10-04 16:28:25 +00:00
|
|
|
id: $id,
|
2019-06-17 15:15:27 +00:00
|
|
|
name: $name,
|
|
|
|
summary: $summary,
|
|
|
|
avatar: $avatar
|
|
|
|
) {
|
|
|
|
id,
|
|
|
|
preferredUsername,
|
|
|
|
name,
|
|
|
|
summary,
|
|
|
|
avatar {
|
|
|
|
url
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
|
|
|
export const DELETE_PERSON = gql`
|
2019-10-04 16:28:25 +00:00
|
|
|
mutation DeletePerson($id: ID!) {
|
|
|
|
deletePerson(id: $id) {
|
2019-06-17 15:15:27 +00:00
|
|
|
preferredUsername,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
2019-01-29 10:02:32 +00:00
|
|
|
/**
|
|
|
|
* This one is used only to register the first account. Prefer CREATE_PERSON when creating another identity
|
|
|
|
*/
|
|
|
|
export const REGISTER_PERSON = gql`
|
|
|
|
mutation ($preferredUsername: String!, $name: String!, $summary: String!, $email: String!) {
|
|
|
|
registerPerson(
|
|
|
|
preferredUsername: $preferredUsername,
|
|
|
|
name: $name,
|
|
|
|
summary: $summary,
|
|
|
|
email: $email
|
|
|
|
) {
|
2019-10-04 16:28:25 +00:00
|
|
|
id,
|
2019-01-29 10:02:32 +00:00
|
|
|
preferredUsername,
|
|
|
|
name,
|
|
|
|
summary,
|
2019-05-22 12:12:11 +00:00
|
|
|
avatar {
|
|
|
|
url
|
|
|
|
},
|
2019-01-29 10:02:32 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|
2019-04-03 15:29:03 +00:00
|
|
|
|
|
|
|
export const FETCH_GROUP = gql`
|
|
|
|
query($name:String!) {
|
|
|
|
group(preferredUsername: $name) {
|
|
|
|
id,
|
|
|
|
url,
|
|
|
|
name,
|
|
|
|
domain,
|
|
|
|
summary,
|
|
|
|
preferredUsername,
|
|
|
|
suspended,
|
2019-05-22 12:12:11 +00:00
|
|
|
avatar {
|
|
|
|
url
|
|
|
|
},
|
|
|
|
banner {
|
|
|
|
url
|
|
|
|
}
|
2019-04-03 15:29:03 +00:00
|
|
|
organizedEvents {
|
|
|
|
uuid,
|
|
|
|
title,
|
|
|
|
beginsOn
|
|
|
|
},
|
|
|
|
members {
|
|
|
|
role,
|
|
|
|
actor {
|
|
|
|
id,
|
|
|
|
name,
|
|
|
|
domain,
|
|
|
|
preferredUsername
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|
2019-09-02 08:50:00 +00:00
|
|
|
|
|
|
|
export const CREATE_GROUP = gql`
|
|
|
|
mutation CreateGroup(
|
2019-09-09 07:31:08 +00:00
|
|
|
$creatorActorId: ID!,
|
2019-09-02 08:50:00 +00:00
|
|
|
$preferredUsername: String!,
|
|
|
|
$name: String!,
|
|
|
|
$summary: String,
|
|
|
|
$avatar: PictureInput,
|
|
|
|
$banner: PictureInput
|
|
|
|
) {
|
|
|
|
createGroup(
|
|
|
|
creatorActorId: $creatorActorId,
|
|
|
|
preferredUsername: $preferredUsername,
|
|
|
|
name: $name,
|
|
|
|
summary: $summary,
|
|
|
|
banner: $banner,
|
|
|
|
avatar: $avatar
|
|
|
|
) {
|
|
|
|
id,
|
|
|
|
preferredUsername,
|
|
|
|
name,
|
|
|
|
summary,
|
|
|
|
avatar {
|
|
|
|
url
|
|
|
|
},
|
|
|
|
banner {
|
|
|
|
url
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|