2018-11-06 10:30:27 +01:00
|
|
|
import gql from 'graphql-tag';
|
|
|
|
|
2019-02-22 11:24:41 +01:00
|
|
|
const participantQuery = `
|
|
|
|
role,
|
|
|
|
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
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
2018-11-06 10:30:27 +01:00
|
|
|
export const FETCH_EVENT = gql`
|
2019-02-22 11:24:41 +01:00
|
|
|
query($uuid:UUID!) {
|
|
|
|
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-05-22 14:12:11 +02:00
|
|
|
picture {
|
|
|
|
id
|
|
|
|
url
|
|
|
|
},
|
2019-03-22 10:57:14 +01:00
|
|
|
publishAt,
|
2019-02-22 16:54:01 +01:00
|
|
|
category,
|
2019-02-22 11:24:41 +01:00
|
|
|
# online_address,
|
|
|
|
# phone_address,
|
2019-03-22 15:51:23 +01:00
|
|
|
physicalAddress {
|
|
|
|
description,
|
|
|
|
floor,
|
|
|
|
street,
|
|
|
|
locality,
|
2019-05-22 14:12:11 +02:00
|
|
|
postalCode,
|
2019-03-22 15:51:23 +01:00
|
|
|
region,
|
|
|
|
country,
|
|
|
|
geom
|
|
|
|
}
|
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-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,
|
|
|
|
# },
|
|
|
|
participants {
|
|
|
|
${participantQuery}
|
2019-04-03 17:29:03 +02:00
|
|
|
},
|
|
|
|
tags {
|
|
|
|
slug,
|
|
|
|
title
|
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-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-02-22 11:24:41 +01:00
|
|
|
mutation CreateEvent(
|
2019-09-02 14:35:50 +02:00
|
|
|
$title: String!,
|
|
|
|
$description: String!,
|
|
|
|
$organizerActorId: ID!,
|
|
|
|
$category: String,
|
|
|
|
$beginsOn: DateTime!,
|
|
|
|
$picture: PictureInput,
|
|
|
|
$tags: [String],
|
|
|
|
$physicalAddress: AddressInput,
|
|
|
|
$visibility: EventVisibility
|
2019-02-22 11:24:41 +01:00
|
|
|
) {
|
|
|
|
createEvent(
|
|
|
|
title: $title,
|
|
|
|
description: $description,
|
|
|
|
beginsOn: $beginsOn,
|
|
|
|
organizerActorId: $organizerActorId,
|
2019-05-22 14:12:11 +02:00
|
|
|
category: $category,
|
2019-07-26 11:30:28 +02:00
|
|
|
picture: $picture,
|
2019-07-30 10:35:29 +02:00
|
|
|
tags: $tags,
|
2019-07-30 16:40:59 +02:00
|
|
|
physicalAddress: $physicalAddress,
|
|
|
|
visibility: $visibility
|
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,
|
|
|
|
picture {
|
|
|
|
url
|
|
|
|
}
|
2019-02-22 11:24:41 +01:00
|
|
|
}
|
|
|
|
}
|
2018-11-06 10:30:27 +01:00
|
|
|
`;
|
|
|
|
|
|
|
|
export const EDIT_EVENT = gql`
|
2019-02-22 11:24:41 +01:00
|
|
|
mutation EditEvent(
|
|
|
|
$title: String!,
|
|
|
|
$description: String!,
|
|
|
|
$organizerActorId: Int!,
|
2019-08-07 16:51:48 +02:00
|
|
|
$category: String
|
2019-02-22 11:24:41 +01:00
|
|
|
) {
|
2019-02-22 16:54:01 +01:00
|
|
|
EditEvent(title: $title, description: $description, organizerActorId: $organizerActorId, category: $category) {
|
2019-02-22 11:24:41 +01:00
|
|
|
uuid
|
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-02-25 17:20:06 +01:00
|
|
|
mutation JoinEvent($eventId: Int!, $actorId: Int!) {
|
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-02-25 17:20:06 +01:00
|
|
|
mutation LeaveEvent($eventId: Int!, $actorId: Int!) {
|
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
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
|
|
|
export const DELETE_EVENT = gql`
|
|
|
|
mutation DeleteEvent($id: Int!, $actorId: Int!) {
|
|
|
|
deleteEvent(
|
2019-07-26 11:30:28 +02:00
|
|
|
eventId: $id,
|
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
|
|
|
`;
|