refactor: split gql queries into files

This commit is contained in:
Rongjian Zhang
2022-10-01 03:49:56 +08:00
parent d5f3bd9f24
commit 7b08f4cc07
31 changed files with 615 additions and 639 deletions

View File

@@ -0,0 +1,68 @@
# import './fragments.graphql'
query Issues($owner: String!, $name: String!, $cursor: String) {
repository(owner: $owner, name: $name) {
issues(
states: OPEN
orderBy: { field: CREATED_AT, direction: DESC }
first: 30
after: $cursor
) {
pageInfo {
...PageInfoParts
}
nodes {
number
title
updatedAt
author {
login
avatarUrl
}
labels(first: 10) {
nodes {
name
color
}
}
comments {
totalCount
}
}
}
}
}
## pulls
query Pulls($owner: String!, $name: String!, $cursor: String) {
repository(owner: $owner, name: $name) {
pullRequests(
states: OPEN
orderBy: { field: CREATED_AT, direction: DESC }
first: 30
after: $cursor
) {
pageInfo {
...PageInfoParts
}
nodes {
number
title
updatedAt
author {
login
avatarUrl
}
labels(first: 10) {
nodes {
name
color
}
}
comments {
totalCount
}
}
}
}
}