generated from actions/javascript-action
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathqueries.js
50 lines (46 loc) · 1.1 KB
/
queries.js
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
const queries = {
findIssues: `query findIssues($owner: String!, $repo: String!, $mentioned: String!, $after: String = null) {
repository(owner: $owner, name: $repo) {
id
issues(after: $after, first: 10, filterBy: {mentioned: $mentioned, createdBy: "github-actions[bot]"}, orderBy: {field: CREATED_AT, direction: DESC}) {
nodes {
id
title
url
}
pageInfo {
hasNextPage
endCursor
}
}
}
}
`,
createIssue: `mutation createIssue($repositoryId: ID!, $title: String!, $body: String = null, $assigneeIds: [ID!] = null) {
createIssue(input: {repositoryId: $repositoryId, title: $title, body: $body, assigneeIds: $assigneeIds}) {
issue {
id
title
url
}
}
}
`,
addComment: `mutation addCommentToIssue($subjectId: ID!, $body: String!) {
addComment(input: {subjectId: $subjectId, body: $body}) {
commentEdge {
node {
url
}
}
}
}
`,
closeIssue: `mutation closeIssue($id: ID!) {
updateIssue(input: {id: $id, state:CLOSED}) {
clientMutationId
}
}
`,
};
module.exports = queries;