39
js/src/graphql/actor.js
Normal file
39
js/src/graphql/actor.js
Normal file
@@ -0,0 +1,39 @@
|
||||
import gql from 'graphql-tag';
|
||||
|
||||
export const FETCH_ACTOR = gql`
|
||||
query($name:String!) {
|
||||
actor(preferredUsername: $name) {
|
||||
url,
|
||||
outboxUrl,
|
||||
inboxUrl,
|
||||
followingUrl,
|
||||
followersUrl,
|
||||
sharedInboxUrl,
|
||||
name,
|
||||
domain,
|
||||
summary,
|
||||
preferredUsername,
|
||||
suspended,
|
||||
avatarUrl,
|
||||
bannerUrl,
|
||||
organizedEvents {
|
||||
uuid,
|
||||
title,
|
||||
description,
|
||||
organizer_actor {
|
||||
avatarUrl,
|
||||
preferred_username,
|
||||
name,
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const LOGGED_ACTOR = gql`
|
||||
query {
|
||||
loggedActor {
|
||||
avatarUrl,
|
||||
preferredUsername,
|
||||
}
|
||||
}`;
|
||||
16
js/src/graphql/auth.js
Normal file
16
js/src/graphql/auth.js
Normal file
@@ -0,0 +1,16 @@
|
||||
import gql from 'graphql-tag';
|
||||
|
||||
export const LOGIN = gql`
|
||||
mutation Login($email: String!, $password: String!) {
|
||||
login(email: $email, password: $password) {
|
||||
token,
|
||||
user {
|
||||
id,
|
||||
},
|
||||
actor {
|
||||
avatarUrl,
|
||||
preferredUsername,
|
||||
}
|
||||
},
|
||||
}
|
||||
`;
|
||||
29
js/src/graphql/category.js
Normal file
29
js/src/graphql/category.js
Normal file
@@ -0,0 +1,29 @@
|
||||
import gql from 'graphql-tag';
|
||||
|
||||
export const FETCH_CATEGORIES = gql`
|
||||
query {
|
||||
categories {
|
||||
id,
|
||||
title,
|
||||
description,
|
||||
picture {
|
||||
url,
|
||||
},
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const CREATE_CATEGORY = gql`
|
||||
mutation createCategory($title: String!, $description: String!, $picture: Upload!) {
|
||||
createCategory(title: $title, description: $description, picture: $picture) {
|
||||
id,
|
||||
title,
|
||||
description,
|
||||
picture {
|
||||
url,
|
||||
url_thumbnail
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
`;
|
||||
109
js/src/graphql/event.js
Normal file
109
js/src/graphql/event.js
Normal file
@@ -0,0 +1,109 @@
|
||||
import gql from 'graphql-tag';
|
||||
|
||||
export const FETCH_EVENT = gql`
|
||||
query($uuid:UUID!) {
|
||||
event(uuid: $uuid) {
|
||||
uuid,
|
||||
url,
|
||||
local,
|
||||
title,
|
||||
description,
|
||||
begins_on,
|
||||
ends_on,
|
||||
state,
|
||||
status,
|
||||
public,
|
||||
thumbnail,
|
||||
large_image,
|
||||
publish_at,
|
||||
# address_type,
|
||||
online_address,
|
||||
phone,
|
||||
organizerActor {
|
||||
avatarUrl,
|
||||
preferredUsername,
|
||||
name,
|
||||
},
|
||||
attributedTo {
|
||||
avatarUrl,
|
||||
preferredUsername,
|
||||
name,
|
||||
},
|
||||
participants {
|
||||
actor {
|
||||
avatarUrl,
|
||||
preferredUsername,
|
||||
name,
|
||||
},
|
||||
role,
|
||||
},
|
||||
category {
|
||||
title,
|
||||
},
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const FETCH_EVENTS = gql`
|
||||
query {
|
||||
events {
|
||||
uuid,
|
||||
url,
|
||||
local,
|
||||
title,
|
||||
description,
|
||||
begins_on,
|
||||
ends_on,
|
||||
state,
|
||||
status,
|
||||
public,
|
||||
thumbnail,
|
||||
large_image,
|
||||
publish_at,
|
||||
# address_type,
|
||||
online_address,
|
||||
phone,
|
||||
organizerActor {
|
||||
avatarUrl,
|
||||
preferredUsername,
|
||||
name,
|
||||
},
|
||||
attributedTo {
|
||||
avatarUrl,
|
||||
preferredUsername,
|
||||
name,
|
||||
},
|
||||
category {
|
||||
title,
|
||||
},
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const CREATE_EVENT = gql`
|
||||
mutation CreateEvent(
|
||||
$title: String!,
|
||||
$description: String!,
|
||||
$organizerActorId: Int!,
|
||||
$categoryId: Int!,
|
||||
$beginsOn: DateTime!,
|
||||
$addressType: AddressType!,
|
||||
) {
|
||||
createEvent(title: $title, description: $description, beginsOn: $beginsOn, organizerActorId: $organizerActorId, categoryId: $categoryId, addressType: $addressType) {
|
||||
uuid
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const EDIT_EVENT = gql`
|
||||
mutation EditEvent(
|
||||
$title: String!,
|
||||
$description: String!,
|
||||
$organizerActorId: Int!,
|
||||
$categoryId: Int!,
|
||||
) {
|
||||
EditEvent(title: $title, description: $description, organizerActorId: $organizerActorId, categoryId: $categoryId) {
|
||||
uuid
|
||||
}
|
||||
}
|
||||
`;
|
||||
1
js/src/graphql/fragmentTypes.json
Normal file
1
js/src/graphql/fragmentTypes.json
Normal file
@@ -0,0 +1 @@
|
||||
{"__schema":{"types":[{"possibleTypes":[{"name":"Event"},{"name":"Actor"}],"name":"SearchResult","kind":"UNION"}]}}
|
||||
17
js/src/graphql/search.js
Normal file
17
js/src/graphql/search.js
Normal file
@@ -0,0 +1,17 @@
|
||||
import gql from 'graphql-tag';
|
||||
|
||||
export const SEARCH = gql`
|
||||
query SearchEvents($searchText: String!) {
|
||||
search(search: $searchText) {
|
||||
...on Event {
|
||||
title,
|
||||
uuid,
|
||||
__typename
|
||||
},
|
||||
...on Actor {
|
||||
preferredUsername,
|
||||
__typename
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
10
js/src/graphql/upload.js
Normal file
10
js/src/graphql/upload.js
Normal file
@@ -0,0 +1,10 @@
|
||||
import gql from 'graphql-tag';
|
||||
|
||||
export const UPLOAD_PICTURE = gql`
|
||||
mutation {
|
||||
uploadPicture(file: "file") {
|
||||
url,
|
||||
url_thumbnail
|
||||
}
|
||||
}
|
||||
`;
|
||||
28
js/src/graphql/user.js
Normal file
28
js/src/graphql/user.js
Normal file
@@ -0,0 +1,28 @@
|
||||
import gql from 'graphql-tag';
|
||||
|
||||
export const CREATE_USER = gql`
|
||||
mutation CreateUser($email: String!, $username: String!, $password: String!) {
|
||||
createUser(email: $email, username: $username, password: $password) {
|
||||
preferredUsername,
|
||||
user {
|
||||
email,
|
||||
confirmationSentAt
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const VALIDATE_USER = gql`
|
||||
mutation ValidateUser($token: String!) {
|
||||
validateUser(token: $token) {
|
||||
token,
|
||||
user {
|
||||
id,
|
||||
},
|
||||
actor {
|
||||
avatarUrl,
|
||||
preferredUsername,
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
Reference in New Issue
Block a user