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,49 @@
# import './fragments.graphql'
fragment CommitsRefCommit on Commit {
history(first: 30, after: $after) {
pageInfo {
...PageInfoParts
}
nodes {
url
messageHeadline
committedDate
author {
name
avatarUrl
user {
login
}
}
status {
state
}
}
}
}
fragment CommitsRef on Ref {
target {
... on Commit {
...CommitsRefCommit
}
}
}
query Commits(
$owner: String!
$name: String!
$ref: String!
$hasRef: Boolean!
$after: String
) {
repository(owner: $owner, name: $name) {
defaultBranchRef @skip(if: $hasRef) {
...CommitsRef
}
ref(qualifiedName: $ref) @include(if: $hasRef) {
...CommitsRef
}
}
}