2020-02-18 08:57:00 +01:00
|
|
|
import gql from "graphql-tag";
|
|
|
|
|
|
|
|
export const GET_TODO = gql`
|
|
|
|
query GetTodo($id: ID!) {
|
|
|
|
todo(id: $id) {
|
|
|
|
id
|
|
|
|
title
|
|
|
|
status
|
|
|
|
dueDate
|
|
|
|
todoList {
|
|
|
|
actor {
|
|
|
|
id
|
|
|
|
preferredUsername
|
2020-10-21 17:49:18 +02:00
|
|
|
domain
|
2020-09-29 09:53:48 +02:00
|
|
|
name
|
2020-02-18 08:57:00 +01:00
|
|
|
}
|
|
|
|
title
|
|
|
|
id
|
|
|
|
}
|
|
|
|
assignedTo {
|
|
|
|
id
|
|
|
|
preferredUsername
|
|
|
|
domain
|
|
|
|
name
|
|
|
|
avatar {
|
2020-10-22 16:19:26 +02:00
|
|
|
id
|
2020-02-18 08:57:00 +01:00
|
|
|
url
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
|
|
|
export const FETCH_TODO_LIST = gql`
|
|
|
|
query FetchTodoList($id: ID!) {
|
|
|
|
todoList(id: $id) {
|
|
|
|
id
|
|
|
|
title
|
|
|
|
todos {
|
|
|
|
total
|
|
|
|
elements {
|
|
|
|
id
|
|
|
|
title
|
|
|
|
status
|
|
|
|
assignedTo {
|
|
|
|
id
|
|
|
|
preferredUsername
|
|
|
|
domain
|
|
|
|
}
|
|
|
|
dueDate
|
|
|
|
}
|
|
|
|
}
|
|
|
|
actor {
|
|
|
|
id
|
|
|
|
preferredUsername
|
|
|
|
domain
|
2020-09-29 09:53:48 +02:00
|
|
|
name
|
2020-02-18 08:57:00 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
|
|
|
export const CREATE_TODO_LIST = gql`
|
|
|
|
mutation CreateTodoList($title: String!, $groupId: ID!) {
|
|
|
|
createTodoList(title: $title, groupId: $groupId) {
|
|
|
|
id
|
|
|
|
title
|
|
|
|
todos {
|
|
|
|
total
|
|
|
|
elements {
|
|
|
|
id
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
|
|
|
export const CREATE_TODO = gql`
|
|
|
|
mutation createTodo(
|
|
|
|
$title: String!
|
|
|
|
$todoListId: ID!
|
|
|
|
$status: Boolean
|
|
|
|
$assignedToId: ID
|
|
|
|
$dueDate: DateTime
|
|
|
|
) {
|
|
|
|
createTodo(
|
|
|
|
title: $title
|
|
|
|
todoListId: $todoListId
|
|
|
|
status: $status
|
|
|
|
assignedToId: $assignedToId
|
|
|
|
dueDate: $dueDate
|
|
|
|
) {
|
|
|
|
id
|
|
|
|
title
|
|
|
|
status
|
|
|
|
assignedTo {
|
|
|
|
id
|
|
|
|
}
|
|
|
|
creator {
|
|
|
|
id
|
|
|
|
}
|
|
|
|
dueDate
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
|
|
|
export const UPDATE_TODO = gql`
|
|
|
|
mutation updateTodo(
|
|
|
|
$id: ID!
|
|
|
|
$title: String
|
|
|
|
$status: Boolean
|
|
|
|
$assignedToId: ID
|
|
|
|
$dueDate: DateTime
|
|
|
|
) {
|
|
|
|
updateTodo(
|
|
|
|
id: $id
|
|
|
|
title: $title
|
|
|
|
status: $status
|
|
|
|
assignedToId: $assignedToId
|
|
|
|
dueDate: $dueDate
|
|
|
|
) {
|
|
|
|
id
|
|
|
|
title
|
|
|
|
status
|
|
|
|
assignedTo {
|
|
|
|
id
|
|
|
|
}
|
|
|
|
creator {
|
|
|
|
id
|
|
|
|
}
|
|
|
|
dueDate
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|