fix: commit history count

This commit is contained in:
Rongjian Zhang 2019-12-07 16:22:05 +08:00
parent fadb053b95
commit 50cfd48e51
3 changed files with 21 additions and 2 deletions

View File

@ -1055,6 +1055,12 @@ class GithubRepositoryQuery
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: '__typename'),
alias: null,
arguments: [],
directives: [],
selectionSet: null),
InlineFragmentNode(
typeCondition: TypeConditionNode(
on: NamedTypeNode(
@ -1110,6 +1116,12 @@ class GithubRepositoryQuery
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: '__typename'),
alias: null,
arguments: [],
directives: [],
selectionSet: null),
InlineFragmentNode(
typeCondition: TypeConditionNode(
on: NamedTypeNode(

View File

@ -59,6 +59,7 @@ query(
defaultBranchRef @skip(if: $branchSpecified) {
name
target {
__typename
... on Commit {
history {
totalCount
@ -69,6 +70,7 @@ query(
ref(qualifiedName: $branch) @include(if: $branchSpecified) {
name
target {
__typename
... on Commit {
history {
totalCount

View File

@ -230,8 +230,13 @@ class RepositoryScreen extends StatelessWidget {
TableViewItem(
leftIconData: Octicons.history,
text: Text('Commits'),
// rightWidget: Text(numberFormat
// .format(ref['target']['history']['totalCount'])),
rightWidget: Text(
numberFormat.format(
(ref.target as GithubRepositoryCommit)
.history
?.totalCount,
),
),
screenBuilder: (_) =>
CommitsScreen(owner, name, branch: branch),
),