2018-11-06 10:30:27 +01:00
|
|
|
import gql from 'graphql-tag';
|
|
|
|
|
2019-01-21 15:08:22 +01:00
|
|
|
export const FETCH_PERSON = gql`
|
2018-11-06 10:30:27 +01:00
|
|
|
query($name:String!) {
|
2019-01-21 15:08:22 +01:00
|
|
|
person(preferredUsername: $name) {
|
2019-03-21 20:23:42 +01:00
|
|
|
id,
|
2018-11-06 10:30:27 +01:00
|
|
|
url,
|
|
|
|
name,
|
|
|
|
domain,
|
|
|
|
summary,
|
|
|
|
preferredUsername,
|
|
|
|
suspended,
|
2019-05-22 14:12:11 +02:00
|
|
|
avatar {
|
2019-06-17 17:15:27 +02:00
|
|
|
name,
|
2019-05-22 14:12:11 +02:00
|
|
|
url
|
|
|
|
},
|
|
|
|
banner {
|
|
|
|
url
|
|
|
|
},
|
2019-03-21 20:23:42 +01:00
|
|
|
feedTokens {
|
|
|
|
token
|
|
|
|
},
|
2018-11-06 10:30:27 +01:00
|
|
|
organizedEvents {
|
|
|
|
uuid,
|
2019-03-21 20:23:42 +01:00
|
|
|
title,
|
|
|
|
beginsOn
|
2018-11-06 10:30:27 +01:00
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
2019-01-21 15:08:22 +01:00
|
|
|
export const LOGGED_PERSON = gql`
|
2018-11-06 10:30:27 +01:00
|
|
|
query {
|
2019-01-21 15:08:22 +01:00
|
|
|
loggedPerson {
|
|
|
|
id,
|
2019-05-22 14:12:11 +02:00
|
|
|
avatar {
|
|
|
|
url
|
|
|
|
},
|
2018-11-06 10:30:27 +01:00
|
|
|
preferredUsername,
|
|
|
|
}
|
|
|
|
}`;
|
2019-01-21 15:08:22 +01:00
|
|
|
|
2019-03-21 20:23:42 +01:00
|
|
|
export const LOGGED_PERSON_WITH_GOING_TO_EVENTS = gql`
|
|
|
|
query {
|
|
|
|
loggedPerson {
|
|
|
|
id,
|
2019-05-22 14:12:11 +02:00
|
|
|
avatar {
|
|
|
|
url
|
|
|
|
},
|
2019-03-21 20:23:42 +01:00
|
|
|
preferredUsername,
|
|
|
|
goingToEvents {
|
|
|
|
uuid,
|
|
|
|
title,
|
|
|
|
beginsOn,
|
|
|
|
participants {
|
|
|
|
actor {
|
|
|
|
id,
|
|
|
|
preferredUsername
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}`;
|
|
|
|
|
2019-01-21 15:08:22 +01:00
|
|
|
export const IDENTITIES = gql`
|
|
|
|
query {
|
|
|
|
identities {
|
2019-06-17 17:15:27 +02:00
|
|
|
id,
|
2019-05-22 14:12:11 +02:00
|
|
|
avatar {
|
|
|
|
url
|
|
|
|
},
|
2019-01-21 15:08:22 +01:00
|
|
|
preferredUsername,
|
|
|
|
name
|
|
|
|
}
|
|
|
|
}`;
|
|
|
|
|
|
|
|
export const CREATE_PERSON = gql`
|
2019-06-17 17:15:27 +02:00
|
|
|
mutation CreatePerson($preferredUsername: String!, $name: String!, $summary: String, $avatar: PictureInput) {
|
2019-01-29 11:02:32 +01:00
|
|
|
createPerson(
|
|
|
|
preferredUsername: $preferredUsername,
|
|
|
|
name: $name,
|
2019-06-17 17:15:27 +02:00
|
|
|
summary: $summary,
|
|
|
|
avatar: $avatar
|
2019-01-29 11:02:32 +01:00
|
|
|
) {
|
2019-06-17 17:15:27 +02:00
|
|
|
id,
|
2019-01-21 15:08:22 +01:00
|
|
|
preferredUsername,
|
|
|
|
name,
|
2019-01-29 11:02:32 +01:00
|
|
|
summary,
|
2019-05-22 14:12:11 +02:00
|
|
|
avatar {
|
|
|
|
url
|
2019-06-17 17:15:27 +02:00
|
|
|
}
|
2019-01-21 15:08:22 +01:00
|
|
|
}
|
|
|
|
}
|
2019-01-29 11:02:32 +01:00
|
|
|
`;
|
|
|
|
|
2019-06-17 17:15:27 +02:00
|
|
|
export const UPDATE_PERSON = gql`
|
|
|
|
mutation UpdatePerson($preferredUsername: String!, $name: String, $summary: String, $avatar: PictureInput) {
|
|
|
|
updatePerson(
|
|
|
|
preferredUsername: $preferredUsername,
|
|
|
|
name: $name,
|
|
|
|
summary: $summary,
|
|
|
|
avatar: $avatar
|
|
|
|
) {
|
|
|
|
id,
|
|
|
|
preferredUsername,
|
|
|
|
name,
|
|
|
|
summary,
|
|
|
|
avatar {
|
|
|
|
url
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
|
|
|
export const DELETE_PERSON = gql`
|
|
|
|
mutation DeletePerson($preferredUsername: String!) {
|
|
|
|
deletePerson(preferredUsername: $preferredUsername) {
|
|
|
|
preferredUsername,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
2019-01-29 11:02:32 +01: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
|
|
|
|
) {
|
|
|
|
preferredUsername,
|
|
|
|
name,
|
|
|
|
summary,
|
2019-05-22 14:12:11 +02:00
|
|
|
avatar {
|
|
|
|
url
|
|
|
|
},
|
2019-01-29 11:02:32 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|
2019-04-03 17:29:03 +02:00
|
|
|
|
|
|
|
export const FETCH_GROUP = gql`
|
|
|
|
query($name:String!) {
|
|
|
|
group(preferredUsername: $name) {
|
|
|
|
id,
|
|
|
|
url,
|
|
|
|
name,
|
|
|
|
domain,
|
|
|
|
summary,
|
|
|
|
preferredUsername,
|
|
|
|
suspended,
|
2019-05-22 14:12:11 +02:00
|
|
|
avatar {
|
|
|
|
url
|
|
|
|
},
|
|
|
|
banner {
|
|
|
|
url
|
|
|
|
}
|
2019-04-03 17:29:03 +02:00
|
|
|
organizedEvents {
|
|
|
|
uuid,
|
|
|
|
title,
|
|
|
|
beginsOn
|
|
|
|
},
|
|
|
|
members {
|
|
|
|
role,
|
|
|
|
actor {
|
|
|
|
id,
|
|
|
|
name,
|
|
|
|
domain,
|
|
|
|
preferredUsername
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|
2019-09-02 10:50:00 +02:00
|
|
|
|
|
|
|
export const CREATE_GROUP = gql`
|
|
|
|
mutation CreateGroup(
|
2019-09-09 09:31:08 +02:00
|
|
|
$creatorActorId: ID!,
|
2019-09-02 10:50:00 +02: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
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|