2018-11-06 10:30:27 +01:00
|
|
|
import gql from 'graphql-tag';
|
|
|
|
|
2019-02-22 11:24:41 +01:00
|
|
|
const participantQuery = `
|
|
|
|
role,
|
2019-09-20 18:22:03 +02:00
|
|
|
id,
|
2019-02-22 11:24:41 +01:00
|
|
|
actor {
|
|
|
|
preferredUsername,
|
2019-05-22 14:12:11 +02:00
|
|
|
avatar {
|
|
|
|
url
|
|
|
|
},
|
2019-02-25 17:20:06 +01:00
|
|
|
name,
|
|
|
|
id
|
2019-09-26 16:38:58 +02:00
|
|
|
},
|
|
|
|
event {
|
|
|
|
id
|
2019-02-22 11:24:41 +01:00
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
2019-09-09 11:21:42 +02:00
|
|
|
const physicalAddressQuery = `
|
|
|
|
description,
|
|
|
|
floor,
|
|
|
|
street,
|
|
|
|
locality,
|
|
|
|
postalCode,
|
|
|
|
region,
|
|
|
|
country,
|
2019-09-20 19:43:29 +02:00
|
|
|
geom,
|
|
|
|
id
|
2019-09-09 11:21:42 +02:00
|
|
|
`;
|
|
|
|
|
|
|
|
const tagsQuery = `
|
|
|
|
id,
|
|
|
|
slug,
|
|
|
|
title
|
|
|
|
`;
|
|
|
|
|
|
|
|
const optionsQuery = `
|
|
|
|
maximumAttendeeCapacity,
|
|
|
|
remainingAttendeeCapacity,
|
|
|
|
showRemainingAttendeeCapacity,
|
|
|
|
offers {
|
|
|
|
price,
|
|
|
|
priceCurrency,
|
|
|
|
url
|
|
|
|
},
|
|
|
|
participationConditions {
|
|
|
|
title,
|
|
|
|
content,
|
|
|
|
url
|
|
|
|
},
|
|
|
|
attendees,
|
|
|
|
program,
|
|
|
|
commentModeration,
|
|
|
|
showParticipationPrice
|
2019-10-03 16:54:56 +02:00
|
|
|
__typename
|
2019-09-09 11:21:42 +02:00
|
|
|
`;
|
|
|
|
|
2018-11-06 10:30:27 +01:00
|
|
|
export const FETCH_EVENT = gql`
|
2019-09-26 16:38:58 +02:00
|
|
|
query($uuid:UUID!) {
|
2019-02-22 11:24:41 +01:00
|
|
|
event(uuid: $uuid) {
|
|
|
|
id,
|
|
|
|
uuid,
|
|
|
|
url,
|
|
|
|
local,
|
|
|
|
title,
|
|
|
|
description,
|
|
|
|
beginsOn,
|
|
|
|
endsOn,
|
|
|
|
status,
|
|
|
|
visibility,
|
2019-09-20 18:22:03 +02:00
|
|
|
joinOptions,
|
2019-10-02 17:59:07 +02:00
|
|
|
draft,
|
2019-05-22 14:12:11 +02:00
|
|
|
picture {
|
|
|
|
id
|
|
|
|
url
|
2019-09-09 11:21:42 +02:00
|
|
|
name
|
2019-05-22 14:12:11 +02:00
|
|
|
},
|
2019-03-22 10:57:14 +01:00
|
|
|
publishAt,
|
2019-02-22 16:54:01 +01:00
|
|
|
category,
|
2019-09-09 09:31:08 +02:00
|
|
|
onlineAddress,
|
|
|
|
phoneAddress,
|
2019-03-22 15:51:23 +01:00
|
|
|
physicalAddress {
|
2019-09-09 11:21:42 +02:00
|
|
|
${physicalAddressQuery}
|
2019-03-22 15:51:23 +01:00
|
|
|
}
|
2019-02-22 11:24:41 +01:00
|
|
|
organizerActor {
|
2019-05-22 14:12:11 +02:00
|
|
|
avatar {
|
|
|
|
url
|
|
|
|
},
|
2019-02-22 11:24:41 +01:00
|
|
|
preferredUsername,
|
2019-04-12 17:00:55 +02:00
|
|
|
domain,
|
2019-02-22 11:24:41 +01:00
|
|
|
name,
|
2019-08-09 11:32:14 +02:00
|
|
|
url,
|
2019-09-04 18:24:31 +02:00
|
|
|
id,
|
2019-02-22 11:24:41 +01:00
|
|
|
},
|
|
|
|
# attributedTo {
|
2019-05-22 14:12:11 +02:00
|
|
|
# avatar {
|
|
|
|
# url,
|
|
|
|
# }
|
2019-02-22 11:24:41 +01:00
|
|
|
# preferredUsername,
|
|
|
|
# name,
|
|
|
|
# },
|
2019-09-11 16:37:30 +02:00
|
|
|
participantStats {
|
|
|
|
approved,
|
|
|
|
unapproved
|
|
|
|
},
|
2019-04-03 17:29:03 +02:00
|
|
|
tags {
|
2019-09-09 11:21:42 +02:00
|
|
|
${tagsQuery}
|
2019-04-12 17:00:55 +02:00
|
|
|
},
|
|
|
|
relatedEvents {
|
|
|
|
uuid,
|
|
|
|
title,
|
|
|
|
beginsOn,
|
|
|
|
physicalAddress {
|
|
|
|
description
|
|
|
|
},
|
|
|
|
organizerActor {
|
2019-05-22 14:12:11 +02:00
|
|
|
avatar {
|
|
|
|
url,
|
|
|
|
},
|
2019-04-12 17:00:55 +02:00
|
|
|
preferredUsername,
|
|
|
|
domain,
|
|
|
|
name,
|
|
|
|
}
|
2019-09-04 18:24:31 +02:00
|
|
|
},
|
|
|
|
options {
|
2019-09-09 11:21:42 +02:00
|
|
|
${optionsQuery}
|
2019-02-22 16:54:01 +01:00
|
|
|
}
|
2019-02-22 11:24:41 +01:00
|
|
|
}
|
|
|
|
}
|
2018-11-06 10:30:27 +01:00
|
|
|
`;
|
|
|
|
|
|
|
|
export const FETCH_EVENTS = gql`
|
2019-02-22 11:24:41 +01:00
|
|
|
query {
|
|
|
|
events {
|
|
|
|
id,
|
|
|
|
uuid,
|
|
|
|
url,
|
|
|
|
local,
|
|
|
|
title,
|
|
|
|
description,
|
|
|
|
beginsOn,
|
|
|
|
endsOn,
|
|
|
|
status,
|
|
|
|
visibility,
|
2019-05-22 14:12:11 +02:00
|
|
|
picture {
|
|
|
|
id
|
|
|
|
url
|
|
|
|
},
|
2019-03-22 10:57:14 +01:00
|
|
|
publishAt,
|
2019-02-22 11:24:41 +01:00
|
|
|
# online_address,
|
|
|
|
# phone_address,
|
2019-03-22 15:51:23 +01:00
|
|
|
physicalAddress {
|
2019-09-20 19:43:29 +02:00
|
|
|
id,
|
2019-04-03 17:29:03 +02:00
|
|
|
description,
|
|
|
|
locality
|
2019-02-22 11:24:41 +01:00
|
|
|
},
|
2019-09-20 19:43:29 +02:00
|
|
|
organizerActor {
|
|
|
|
id,
|
2019-05-22 14:12:11 +02:00
|
|
|
avatar {
|
|
|
|
url
|
|
|
|
},
|
2019-02-22 11:24:41 +01:00
|
|
|
preferredUsername,
|
|
|
|
name,
|
|
|
|
},
|
2019-09-20 19:43:29 +02:00
|
|
|
# attributedTo {
|
|
|
|
# avatar {
|
|
|
|
# url
|
|
|
|
# },
|
|
|
|
# preferredUsername,
|
|
|
|
# name,
|
|
|
|
# },
|
2019-02-22 16:54:01 +01:00
|
|
|
category,
|
2019-02-22 11:24:41 +01:00
|
|
|
participants {
|
|
|
|
${participantQuery}
|
2019-04-24 20:49:52 +02:00
|
|
|
},
|
|
|
|
tags {
|
|
|
|
slug,
|
|
|
|
title
|
|
|
|
},
|
2018-11-06 10:30:27 +01:00
|
|
|
}
|
2019-02-22 11:24:41 +01:00
|
|
|
}
|
2018-11-06 10:30:27 +01:00
|
|
|
`;
|
|
|
|
|
|
|
|
export const CREATE_EVENT = gql`
|
2019-09-09 11:21:42 +02:00
|
|
|
mutation createEvent(
|
|
|
|
$organizerActorId: ID!,
|
2019-09-02 14:35:50 +02:00
|
|
|
$title: String!,
|
|
|
|
$description: String!,
|
|
|
|
$beginsOn: DateTime!,
|
2019-09-04 18:24:31 +02:00
|
|
|
$endsOn: DateTime,
|
2019-09-09 11:21:42 +02:00
|
|
|
$status: EventStatus,
|
2019-09-20 18:22:03 +02:00
|
|
|
$visibility: EventVisibility,
|
|
|
|
$joinOptions: EventJoinOptions,
|
2019-10-02 17:59:07 +02:00
|
|
|
$draft: Boolean,
|
2019-09-02 14:35:50 +02:00
|
|
|
$tags: [String],
|
2019-09-09 11:21:42 +02:00
|
|
|
$picture: PictureInput,
|
|
|
|
$onlineAddress: String,
|
|
|
|
$phoneAddress: String,
|
|
|
|
$category: String,
|
2019-09-02 14:35:50 +02:00
|
|
|
$physicalAddress: AddressInput,
|
2019-09-09 11:21:42 +02:00
|
|
|
$options: EventOptionsInput,
|
2019-02-22 11:24:41 +01:00
|
|
|
) {
|
|
|
|
createEvent(
|
2019-09-09 11:21:42 +02:00
|
|
|
organizerActorId: $organizerActorId,
|
2019-02-22 11:24:41 +01:00
|
|
|
title: $title,
|
|
|
|
description: $description,
|
|
|
|
beginsOn: $beginsOn,
|
2019-09-04 18:24:31 +02:00
|
|
|
endsOn: $endsOn,
|
2019-09-09 11:21:42 +02:00
|
|
|
status: $status,
|
|
|
|
visibility: $visibility,
|
2019-09-20 18:22:03 +02:00
|
|
|
joinOptions: $joinOptions,
|
2019-10-02 17:59:07 +02:00
|
|
|
draft: $draft,
|
2019-09-09 11:21:42 +02:00
|
|
|
tags: $tags,
|
|
|
|
picture: $picture,
|
|
|
|
onlineAddress: $onlineAddress,
|
|
|
|
phoneAddress: $phoneAddress,
|
2019-05-22 14:12:11 +02:00
|
|
|
category: $category,
|
2019-09-09 11:21:42 +02:00
|
|
|
physicalAddress: $physicalAddress
|
2019-08-28 11:28:27 +02:00
|
|
|
options: $options,
|
2018-11-07 16:09:28 +01:00
|
|
|
) {
|
2019-02-22 11:24:41 +01:00
|
|
|
id,
|
|
|
|
uuid,
|
2019-05-22 14:12:11 +02:00
|
|
|
title,
|
2019-10-04 18:28:25 +02:00
|
|
|
url,
|
|
|
|
local,
|
2019-09-09 11:21:42 +02:00
|
|
|
description,
|
|
|
|
beginsOn,
|
|
|
|
endsOn,
|
|
|
|
status,
|
|
|
|
visibility,
|
2019-09-20 18:22:03 +02:00
|
|
|
joinOptions,
|
2019-10-02 17:59:07 +02:00
|
|
|
draft,
|
2019-05-22 14:12:11 +02:00
|
|
|
picture {
|
2019-09-09 11:21:42 +02:00
|
|
|
id
|
2019-05-22 14:12:11 +02:00
|
|
|
url
|
2019-09-09 11:21:42 +02:00
|
|
|
},
|
|
|
|
publishAt,
|
|
|
|
category,
|
2019-09-09 09:31:08 +02:00
|
|
|
onlineAddress,
|
|
|
|
phoneAddress,
|
2019-09-09 11:21:42 +02:00
|
|
|
physicalAddress {
|
|
|
|
${physicalAddressQuery}
|
|
|
|
},
|
2019-10-04 18:28:25 +02:00
|
|
|
organizerActor {
|
|
|
|
avatar {
|
|
|
|
url
|
|
|
|
},
|
|
|
|
preferredUsername,
|
|
|
|
domain,
|
|
|
|
name,
|
|
|
|
url,
|
|
|
|
id,
|
|
|
|
},
|
|
|
|
participantStats {
|
|
|
|
approved,
|
|
|
|
unapproved
|
|
|
|
},
|
2019-09-09 11:21:42 +02:00
|
|
|
tags {
|
|
|
|
${tagsQuery}
|
|
|
|
},
|
|
|
|
options {
|
|
|
|
${optionsQuery}
|
2019-05-22 14:12:11 +02:00
|
|
|
}
|
2019-02-22 11:24:41 +01:00
|
|
|
}
|
|
|
|
}
|
2018-11-06 10:30:27 +01:00
|
|
|
`;
|
|
|
|
|
|
|
|
export const EDIT_EVENT = gql`
|
2019-09-04 18:24:31 +02:00
|
|
|
mutation updateEvent(
|
2019-09-09 11:21:42 +02:00
|
|
|
$id: ID!,
|
|
|
|
$title: String,
|
|
|
|
$description: String,
|
|
|
|
$beginsOn: DateTime,
|
|
|
|
$endsOn: DateTime,
|
2019-09-09 09:31:08 +02:00
|
|
|
$status: EventStatus,
|
2019-09-20 18:22:03 +02:00
|
|
|
$visibility: EventVisibility,
|
|
|
|
$joinOptions: EventJoinOptions,
|
2019-10-02 17:59:07 +02:00
|
|
|
$draft: Boolean,
|
2019-09-09 11:21:42 +02:00
|
|
|
$tags: [String],
|
|
|
|
$picture: PictureInput,
|
|
|
|
$onlineAddress: String,
|
|
|
|
$phoneAddress: String,
|
|
|
|
$category: String,
|
|
|
|
$physicalAddress: AddressInput,
|
|
|
|
$options: EventOptionsInput,
|
2019-02-22 11:24:41 +01:00
|
|
|
) {
|
2019-09-09 11:21:42 +02:00
|
|
|
updateEvent(
|
|
|
|
eventId: $id,
|
|
|
|
title: $title,
|
|
|
|
description: $description,
|
|
|
|
beginsOn: $beginsOn,
|
|
|
|
endsOn: $endsOn,
|
|
|
|
status: $status,
|
|
|
|
visibility: $visibility,
|
2019-09-20 18:22:03 +02:00
|
|
|
joinOptions: $joinOptions,
|
2019-10-02 17:59:07 +02:00
|
|
|
draft: $draft,
|
2019-09-09 11:21:42 +02:00
|
|
|
tags: $tags,
|
|
|
|
picture: $picture,
|
|
|
|
onlineAddress: $onlineAddress,
|
|
|
|
phoneAddress: $phoneAddress,
|
|
|
|
category: $category,
|
|
|
|
physicalAddress: $physicalAddress
|
|
|
|
options: $options,
|
|
|
|
) {
|
|
|
|
id,
|
|
|
|
uuid,
|
|
|
|
title,
|
2019-10-03 16:54:56 +02:00
|
|
|
url,
|
|
|
|
local,
|
2019-09-09 11:21:42 +02:00
|
|
|
description,
|
|
|
|
beginsOn,
|
|
|
|
endsOn,
|
|
|
|
status,
|
|
|
|
visibility,
|
2019-09-20 18:22:03 +02:00
|
|
|
joinOptions,
|
2019-10-02 17:59:07 +02:00
|
|
|
draft,
|
2019-09-09 11:21:42 +02:00
|
|
|
picture {
|
|
|
|
id
|
|
|
|
url
|
|
|
|
},
|
|
|
|
publishAt,
|
|
|
|
category,
|
2019-09-09 09:31:08 +02:00
|
|
|
onlineAddress,
|
|
|
|
phoneAddress,
|
2019-09-09 11:21:42 +02:00
|
|
|
physicalAddress {
|
|
|
|
${physicalAddressQuery}
|
|
|
|
},
|
2019-10-03 16:54:56 +02:00
|
|
|
organizerActor {
|
|
|
|
avatar {
|
|
|
|
url
|
|
|
|
},
|
|
|
|
preferredUsername,
|
|
|
|
domain,
|
|
|
|
name,
|
|
|
|
url,
|
|
|
|
id,
|
|
|
|
},
|
|
|
|
participantStats {
|
|
|
|
approved,
|
|
|
|
unapproved
|
|
|
|
},
|
2019-09-09 11:21:42 +02:00
|
|
|
tags {
|
|
|
|
${tagsQuery}
|
|
|
|
},
|
|
|
|
options {
|
|
|
|
${optionsQuery}
|
|
|
|
}
|
2018-11-06 10:30:27 +01:00
|
|
|
}
|
2019-02-22 11:24:41 +01:00
|
|
|
}
|
2018-11-06 10:30:27 +01:00
|
|
|
`;
|
2019-01-21 15:08:22 +01:00
|
|
|
|
|
|
|
export const JOIN_EVENT = gql`
|
2019-09-09 09:31:08 +02:00
|
|
|
mutation JoinEvent($eventId: ID!, $actorId: ID!) {
|
2019-02-22 11:24:41 +01:00
|
|
|
joinEvent(
|
2019-02-25 17:20:06 +01:00
|
|
|
eventId: $eventId,
|
2019-02-22 11:24:41 +01:00
|
|
|
actorId: $actorId
|
|
|
|
) {
|
|
|
|
${participantQuery}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
|
|
|
export const LEAVE_EVENT = gql`
|
2019-09-09 09:31:08 +02:00
|
|
|
mutation LeaveEvent($eventId: ID!, $actorId: ID!) {
|
2019-02-22 11:24:41 +01:00
|
|
|
leaveEvent(
|
2019-02-25 17:20:06 +01:00
|
|
|
eventId: $eventId,
|
2019-02-22 11:24:41 +01:00
|
|
|
actorId: $actorId
|
2019-01-21 15:08:22 +01:00
|
|
|
) {
|
2019-02-22 11:24:41 +01:00
|
|
|
actor {
|
|
|
|
id
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
2019-09-30 13:48:47 +02:00
|
|
|
export const UPDATE_PARTICIPANT = gql`
|
|
|
|
mutation AcceptParticipant($id: ID!, $moderatorActorId: ID!, $role: ParticipantRoleEnum!) {
|
|
|
|
updateParticipation(id: $id, moderatorActorId: $moderatorActorId, role: $role) {
|
2019-09-20 18:22:03 +02:00
|
|
|
role,
|
|
|
|
id
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
2019-02-22 11:24:41 +01:00
|
|
|
export const DELETE_EVENT = gql`
|
2019-09-09 09:31:08 +02:00
|
|
|
mutation DeleteEvent($eventId: ID!, $actorId: ID!) {
|
2019-02-22 11:24:41 +01:00
|
|
|
deleteEvent(
|
2019-09-09 09:31:08 +02:00
|
|
|
eventId: $eventId,
|
2019-02-22 11:24:41 +01:00
|
|
|
actorId: $actorId
|
2019-07-26 11:30:28 +02:00
|
|
|
) {
|
|
|
|
id
|
|
|
|
}
|
2019-02-22 11:24:41 +01:00
|
|
|
}
|
2019-01-21 15:08:22 +01:00
|
|
|
`;
|
2019-09-20 18:22:03 +02:00
|
|
|
|
|
|
|
export const PARTICIPANTS = gql`
|
2019-09-26 16:38:58 +02:00
|
|
|
query($uuid: UUID!, $page: Int, $limit: Int, $roles: String, $actorId: ID!) {
|
2019-09-20 18:22:03 +02:00
|
|
|
event(uuid: $uuid) {
|
2019-09-26 16:38:58 +02:00
|
|
|
id,
|
|
|
|
participants(page: $page, limit: $limit, roles: $roles, actorId: $actorId) {
|
2019-09-20 18:22:03 +02:00
|
|
|
${participantQuery}
|
|
|
|
},
|
|
|
|
participantStats {
|
|
|
|
approved,
|
2019-09-30 13:48:47 +02:00
|
|
|
unapproved,
|
|
|
|
rejected
|
2019-09-20 18:22:03 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|
2019-09-26 16:38:58 +02:00
|
|
|
|
|
|
|
export const EVENT_PERSON_PARTICIPATION = gql`
|
2019-10-04 18:28:25 +02:00
|
|
|
query($actorId: ID!, $eventId: ID!) {
|
|
|
|
person(id: $actorId) {
|
2019-09-26 16:38:58 +02:00
|
|
|
id,
|
|
|
|
participations(eventId: $eventId) {
|
|
|
|
id,
|
|
|
|
role,
|
|
|
|
actor {
|
|
|
|
id
|
|
|
|
},
|
|
|
|
event {
|
|
|
|
id
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|