-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathqueries.js
More file actions
184 lines (162 loc) · 4.46 KB
/
queries.js
File metadata and controls
184 lines (162 loc) · 4.46 KB
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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
import { gql } from "@apollo/client";
// Card Mutations
export const EDIT_CARD = gql`
mutation EDIT_CARD($isArchived: Boolean, $note: String, $projectCardId: ID!) {
updateProjectCard(input: {isArchived: $isArchived, note: $note, projectCardId: $projectCardId }) {
clientMutationId
}
}
`;
export const DELETE_CARD = gql`
mutation DELETE_CARD($cardId: ID!) {
deleteProjectCard(input: { cardId: $cardId }) {
clientMutationId
}
}
`;
export const ADD_CARD = gql`
mutation ADD_CARD($contentId: ID, $note: String, $projectColumnId: ID!) {
addProjectCard(input: { contentId: $contentId, note: $note, projectColumnId: $projectColumnId }) {
clientMutationId
}
}
`;
export const SWITCH_CARD_COLUMN = gql`
mutation SWITCH_CARD_COLUMN($afterCardId: ID, $cardId: ID!, $columnId: ID!) {
moveProjectCard(input: { afterCardId: $afterCardId, cardId: $cardId, columnId: $columnId }) {
clientMutationId
}
}
`;
export const CONVERT_CARD_TO_ISSUE = gql`
mutation CONVERT_CARD_TO_ISSUE($body: String, $projectCardId: ID!, $repositoryId: ID!, $title: String) {
convertProjectCardNoteToIssue(input: { body: $body, projectCardId: $projectCardId, repositoryId: $repositoryId, title: $title }) {
clientMutationId
}
}
`;
// Column Mutations
export const DELETE_COLUMN = gql`
mutation DELETE_COLUMN($columnId: ID!) {
deleteProjectColumn(input: { columnId: $columnId }) {
clientMutationId
}
}
`;
export const ADD_COLUMN = gql`
mutation ADD_COLUMN($name: String!, $projectId: ID!) {
addProjectColumn(input : { name: $name, projectId: $projectId }) {
clientMutationId
}
}
`;
export const EDIT_COLUMN = gql`
mutation EDIT_COLUMN($name: String!, $projectColumnId: ID!) {
updateProjectColumn(input : { name: $name, projectColumnId: $projectColumnId }) {
clientMutationId
}
}
`;
export const ADD_PROJECT = gql`
mutation ADD_PROJECT($body: String, $name: String!, $ownerId: ID!, $repositoryIds: [ID!], $template: ProjectTemplate) {
createProject(input : { body: $body, name: $name, ownerId: $ownerId, repositoryIds: $repositoryIds, template: $template }) {
clientMutationId
}
}
`;
export const CLOSE_PROJECT = gql`
mutation CLOSE_PROJECT($projectId: ID!) {
createProject(input : { projectId: $projectId }) {
clientMutationId
}
}
`;
export const EDIT_PROJECT = gql`
mutation EDIT_PROJECT($body: String, $name: String, $projectId: ID!, $public: Boolean, $state: ProjectState) {
createProject(input : { $body: body, name: $name, projectId: $projectId, public: $public, state: $state }) {
clientMutationId
}
}
`;
export const GET_REPO_PROJECT_INFO = gql`
query GetRepoProjectInfo($name: String!, $owner: String!, $number: Int!) {
repository(name: $name, owner: $owner) {
id
project(number: $number) {
id
name
body
columns(first: 100) {
nodes {
id
name
cards(first: 100) {
nodes {
content {
...fieldsIssue
...fieldsPR
}
id
note
isArchived
state
}
}
}
}
}
}
rateLimit {
limit
cost
remaining
resetAt
}
}
fragment fieldsIssue on Issue {
title
}
fragment fieldsPR on PullRequest {
title
}
`;
export const GET_ORG_PROJECT_INFO = gql`
query GetOrgProjectInfo($login: String!, $number: Int!) {
organization(login: $login) {
project(number: $number) {
id
name
body
columns(first: 100) {
nodes {
id
name
cards(first: 100) {
nodes {
content {
...fieldsIssue
...fieldsPR
}
note
isArchived
state
}
}
}
}
}
}
rateLimit {
limit
cost
remaining
resetAt
}
}
fragment fieldsIssue on Issue {
title
}
fragment fieldsPR on PullRequest {
title
}
`;