2018-11-06 10:30:27 +01:00
|
|
|
import gql from 'graphql-tag';
|
|
|
|
|
|
|
|
export const FETCH_EVENT = gql`
|
|
|
|
query($uuid:UUID!) {
|
|
|
|
event(uuid: $uuid) {
|
2019-01-21 15:08:22 +01:00
|
|
|
id,
|
2018-11-06 10:30:27 +01:00
|
|
|
uuid,
|
|
|
|
url,
|
|
|
|
local,
|
|
|
|
title,
|
|
|
|
description,
|
2019-01-21 15:08:22 +01:00
|
|
|
beginsOn,
|
|
|
|
endsOn,
|
2018-11-06 10:30:27 +01:00
|
|
|
status,
|
2019-01-14 17:48:08 +01:00
|
|
|
visibility,
|
2018-11-06 10:30:27 +01:00
|
|
|
thumbnail,
|
|
|
|
large_image,
|
|
|
|
publish_at,
|
2019-01-11 14:24:33 +01:00
|
|
|
# online_address,
|
2019-01-14 17:48:08 +01:00
|
|
|
# phone_address,
|
2018-11-06 10:30:27 +01:00
|
|
|
organizerActor {
|
|
|
|
avatarUrl,
|
|
|
|
preferredUsername,
|
|
|
|
name,
|
|
|
|
},
|
2019-01-21 15:08:22 +01:00
|
|
|
# attributedTo {
|
|
|
|
# # avatarUrl,
|
|
|
|
# preferredUsername,
|
|
|
|
# name,
|
|
|
|
# },
|
2018-11-06 10:30:27 +01:00
|
|
|
participants {
|
|
|
|
actor {
|
|
|
|
avatarUrl,
|
|
|
|
preferredUsername,
|
|
|
|
name,
|
|
|
|
},
|
|
|
|
role,
|
|
|
|
},
|
|
|
|
category {
|
|
|
|
title,
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
|
|
|
export const FETCH_EVENTS = gql`
|
|
|
|
query {
|
|
|
|
events {
|
2019-01-21 15:08:22 +01:00
|
|
|
id,
|
2018-11-06 10:30:27 +01:00
|
|
|
uuid,
|
|
|
|
url,
|
|
|
|
local,
|
|
|
|
title,
|
|
|
|
description,
|
2019-01-21 15:08:22 +01:00
|
|
|
beginsOn,
|
|
|
|
endsOn,
|
2018-11-06 10:30:27 +01:00
|
|
|
status,
|
2019-01-14 17:48:08 +01:00
|
|
|
visibility,
|
2018-11-06 10:30:27 +01:00
|
|
|
thumbnail,
|
|
|
|
large_image,
|
|
|
|
publish_at,
|
2019-01-11 14:24:33 +01:00
|
|
|
# online_address,
|
2019-01-14 17:48:08 +01:00
|
|
|
# phone_address,
|
2018-11-06 10:30:27 +01:00
|
|
|
organizerActor {
|
|
|
|
avatarUrl,
|
|
|
|
preferredUsername,
|
|
|
|
name,
|
|
|
|
},
|
|
|
|
attributedTo {
|
|
|
|
avatarUrl,
|
|
|
|
preferredUsername,
|
|
|
|
name,
|
|
|
|
},
|
|
|
|
category {
|
|
|
|
title,
|
|
|
|
},
|
2019-01-21 15:08:22 +01:00
|
|
|
participants {
|
|
|
|
role,
|
|
|
|
actor {
|
|
|
|
preferredUsername,
|
|
|
|
avatarUrl,
|
|
|
|
name
|
|
|
|
}
|
2018-11-06 10:30:27 +01:00
|
|
|
}
|
|
|
|
}
|
2019-01-21 15:08:22 +01:00
|
|
|
}
|
2018-11-06 10:30:27 +01:00
|
|
|
`;
|
|
|
|
|
|
|
|
export const CREATE_EVENT = gql`
|
|
|
|
mutation CreateEvent(
|
|
|
|
$title: String!,
|
|
|
|
$description: String!,
|
2019-01-21 15:08:22 +01:00
|
|
|
$organizerActorId: String!,
|
|
|
|
$category: String!,
|
2019-01-15 14:18:54 +01:00
|
|
|
$beginsOn: DateTime!
|
2018-11-07 16:09:28 +01:00
|
|
|
) {
|
|
|
|
createEvent(
|
2018-12-21 17:10:39 +01:00
|
|
|
title: $title,
|
|
|
|
description: $description,
|
|
|
|
beginsOn: $beginsOn,
|
|
|
|
organizerActorId: $organizerActorId,
|
2019-01-21 15:08:22 +01:00
|
|
|
category: $category
|
|
|
|
) {
|
|
|
|
id,
|
|
|
|
uuid,
|
|
|
|
title
|
|
|
|
}
|
2018-11-06 10:30:27 +01:00
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
|
|
|
export const EDIT_EVENT = gql`
|
|
|
|
mutation EditEvent(
|
|
|
|
$title: String!,
|
|
|
|
$description: String!,
|
|
|
|
$organizerActorId: Int!,
|
2019-01-15 14:18:54 +01:00
|
|
|
$categoryId: Int!
|
2018-11-06 10:30:27 +01:00
|
|
|
) {
|
|
|
|
EditEvent(title: $title, description: $description, organizerActorId: $organizerActorId, categoryId: $categoryId) {
|
|
|
|
uuid
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|
2019-01-21 15:08:22 +01:00
|
|
|
|
|
|
|
export const JOIN_EVENT = gql`
|
|
|
|
mutation JoinEvent(
|
|
|
|
$uuid: String!,
|
|
|
|
$username: String!
|
|
|
|
) {
|
|
|
|
joinEvent(
|
|
|
|
uuid: $uuid,
|
|
|
|
username: $username
|
|
|
|
)
|
|
|
|
}
|
|
|
|
`;
|