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-02-22 11:24:41 +01:00
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
2019-09-09 11:21:42 +02:00
|
|
|
const physicalAddressQuery = `
|
|
|
|
description,
|
|
|
|
floor,
|
|
|
|
street,
|
|
|
|
locality,
|
|
|
|
postalCode,
|
|
|
|
region,
|
|
|
|
country,
|
|
|
|
geom
|
|
|
|
`;
|
|
|
|
|
|
|
|
const tagsQuery = `
|
|
|
|
id,
|
|
|
|
slug,
|
|
|
|
title
|
|
|
|
`;
|
|
|
|
|
|
|
|
const optionsQuery = `
|
|
|
|
maximumAttendeeCapacity,
|
|
|
|
remainingAttendeeCapacity,
|
|
|
|
showRemainingAttendeeCapacity,
|
|
|
|
offers {
|
|
|
|
price,
|
|
|
|
priceCurrency,
|
|
|
|
url
|
|
|
|
},
|
|
|
|
participationConditions {
|
|
|
|
title,
|
|
|
|
content,
|
|
|
|
url
|
|
|
|
},
|
|
|
|
attendees,
|
|
|
|
program,
|
|
|
|
commentModeration,
|
|
|
|
showParticipationPrice
|
|
|
|
`;
|
|
|
|
|
2018-11-06 10:30:27 +01:00
|
|
|
export const FETCH_EVENT = gql`
|
2019-09-20 18:22:03 +02:00
|
|
|
query($uuid:UUID!, $roles: String) {
|
2019-02-22 11:24:41 +01:00
|
|
|
event(uuid: $uuid) {
|
|
|
|
id,
|
|
|
|
uuid,
|
|
|
|
url,
|
|
|
|
local,
|
|
|
|
title,
|
2019-04-11 14:57:13 +02:00
|
|
|
slug,
|
2019-02-22 11:24:41 +01:00
|
|
|
description,
|
|
|
|
beginsOn,
|
|
|
|
endsOn,
|
|
|
|
status,
|
|
|
|
visibility,
|
2019-09-20 18:22:03 +02:00
|
|
|
joinOptions,
|
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-20 18:22:03 +02:00
|
|
|
participants (roles: $roles) {
|
2019-02-22 11:24:41 +01:00
|
|
|
${participantQuery}
|
2019-04-03 17:29:03 +02:00
|
|
|
},
|
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-04-03 17:29:03 +02:00
|
|
|
description,
|
|
|
|
locality
|
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,
|
|
|
|
name,
|
|
|
|
},
|
|
|
|
attributedTo {
|
2019-05-22 14:12:11 +02:00
|
|
|
avatar {
|
|
|
|
url
|
|
|
|
},
|
2019-02-22 11:24:41 +01:00
|
|
|
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-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-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-09-09 11:21:42 +02:00
|
|
|
description,
|
|
|
|
beginsOn,
|
|
|
|
endsOn,
|
|
|
|
status,
|
|
|
|
visibility,
|
2019-09-20 18:22:03 +02:00
|
|
|
joinOptions,
|
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}
|
|
|
|
},
|
|
|
|
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-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-09-09 11:21:42 +02:00
|
|
|
tags: $tags,
|
|
|
|
picture: $picture,
|
|
|
|
onlineAddress: $onlineAddress,
|
|
|
|
phoneAddress: $phoneAddress,
|
|
|
|
category: $category,
|
|
|
|
physicalAddress: $physicalAddress
|
|
|
|
options: $options,
|
|
|
|
) {
|
|
|
|
id,
|
|
|
|
uuid,
|
|
|
|
title,
|
|
|
|
description,
|
|
|
|
beginsOn,
|
|
|
|
endsOn,
|
|
|
|
status,
|
|
|
|
visibility,
|
2019-09-20 18:22:03 +02:00
|
|
|
joinOptions,
|
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}
|
|
|
|
},
|
|
|
|
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-20 18:22:03 +02:00
|
|
|
export const ACCEPT_PARTICIPANT = gql`
|
|
|
|
mutation AcceptParticipant($id: ID!, $moderatorActorId: ID!) {
|
|
|
|
acceptParticipation(id: $id, moderatorActorId: $moderatorActorId) {
|
|
|
|
role,
|
|
|
|
id
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
|
|
|
export const REJECT_PARTICIPANT = gql`
|
|
|
|
mutation RejectParticipant($id: ID!, $moderatorActorId: ID!) {
|
|
|
|
rejectParticipation(id: $id, moderatorActorId: $moderatorActorId) {
|
|
|
|
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`
|
|
|
|
query($uuid: UUID!, $page: Int, $limit: Int, $roles: String) {
|
|
|
|
event(uuid: $uuid) {
|
|
|
|
participants(page: $page, limit: $limit, roles: $roles) {
|
|
|
|
${participantQuery}
|
|
|
|
},
|
|
|
|
participantStats {
|
|
|
|
approved,
|
|
|
|
unapproved
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|