-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathoperations.graphql
124 lines (110 loc) · 1.79 KB
/
operations.graphql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
fragment columnOrder on Column {
colID
order
}
fragment columnWithTickets on Column {
colID
name
tickets {
...ticketDetailsWithComments
}
order
}
fragment commentDetails on Comment {
id
text
datetime
author {
...userNames
}
}
fragment projectAllDetails on Project {
projID
name
url
description
order
}
fragment projectOrder on Project {
projID
order
}
fragment roleDetails on Role {
id
permission
assignedTo {
...userNames
}
}
fragment ticketDetailsWithComments on Ticket {
id
title
description
assigned {
...userNames
}
comments(order: { desc: datetime }) {
...commentDetails
}
}
fragment ticketWithColumn on Ticket {
...ticketDetails
onColumn {
...columnDetails
}
}
fragment userNames on User {
username
displayName
image
}
# -----
# Query
# -----
query getProject($projectID: ID!) {
getProject(projID: $projectID) {
...projectAllDetails
admin {
...userNames
}
roles {
...roleDetails
}
columns {
...columnWithTickets
}
}
}
# --------
# Mutation
# --------
mutation moveTicket($id: ID!, $colID: ID!, $order: String!) {
updateTicket(
input: { filter: { id: [$id] }, set: { onColumn: { colID: $colID } } }
) {
ticket {
...ticketWithColumn
}
}
updateColumn(input: { filter: { colID: [$colID] }, set: { order: $order } }) {
column {
...columnOrder
}
}
}
mutation setColumnOrder($projID: ID!, $order: String!) {
updateProject(
input: { filter: { projID: [$projID] }, set: { order: $order } }
) {
project {
...projectOrder
}
}
}
mutation setTicketOrder($colID: ID!, $order: String!) {
updateColumn(input: { filter: { colID: [$colID] }, set: { order: $order } }) {
column {
...columnOrder
}
}
}