diff --git a/lib/graphql/github_repository.dart b/lib/graphql/github_repository.dart index 1130e4a..c232e8c 100644 --- a/lib/graphql/github_repository.dart +++ b/lib/graphql/github_repository.dart @@ -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( diff --git a/lib/graphql/github_repository.graphql b/lib/graphql/github_repository.graphql index 4ffd365..0226593 100644 --- a/lib/graphql/github_repository.graphql +++ b/lib/graphql/github_repository.graphql @@ -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 diff --git a/lib/screens/repository.dart b/lib/screens/repository.dart index 8022399..b3dbdd3 100644 --- a/lib/screens/repository.dart +++ b/lib/screens/repository.dart @@ -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), ),