Skip to content

Commit d4e8300

Browse files
Add graphql queries
1 parent 119b5f9 commit d4e8300

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed
+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
import gql from 'graphql-tag';
2+
3+
export const ADD_TASK = gql`
4+
mutation createTask($description: String!, $title: String!){
5+
createTask(description: $description, title: $title){
6+
id
7+
title
8+
description
9+
version
10+
}
11+
}
12+
`;
13+
14+
export const GET_TASKS = gql`
15+
query allTasks($first: Int) {
16+
allTasks(first: $first) {
17+
id
18+
title
19+
description
20+
version
21+
}
22+
}
23+
`;
24+
25+
export const DELETE_TASK = gql`
26+
mutation deleteTask($id: ID!){
27+
deleteTask(id: $id)
28+
}
29+
`;
30+
31+
export const UPDATE_TASK = gql`
32+
mutation updateTask($description: String, $id: ID!, $title: String, $version: Int!) {
33+
updateTask(description: $description, id: $id, title: $title, version: $version) {
34+
id
35+
title
36+
description
37+
version
38+
}
39+
}
40+
`;
41+
42+
export const TASK_MUTATED_SUBSCRIPTION = gql`
43+
subscription tasks {
44+
tasks {
45+
action
46+
task {
47+
id
48+
title
49+
description
50+
version
51+
}
52+
}
53+
}
54+
`;

0 commit comments

Comments
 (0)