1
0
mirror of https://github.com/git-touch/git-touch synced 2025-02-20 13:30:38 +01:00

fix: totalcount

This commit is contained in:
Rongjian Zhang 2019-12-07 13:31:54 +08:00
parent 6b095e8a3b
commit 0b743ffddb
4 changed files with 13 additions and 3 deletions

View File

@ -428,10 +428,12 @@ class PinnableItemConnection with EquatableMixin {
factory PinnableItemConnection.fromJson(Map<String, dynamic> json) =>
_$PinnableItemConnectionFromJson(json);
int totalCount;
List<PinnableItem> nodes;
@override
List<Object> get props => [nodes];
List<Object> get props => [totalCount, nodes];
Map<String, dynamic> toJson() => _$PinnableItemConnectionToJson(this);
}
@ -891,6 +893,12 @@ class GhUserQuery extends GraphQLQuery<GhUser, GhUserArguments> {
],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'totalCount'),
alias: null,
arguments: [],
directives: [],
selectionSet: null),
FieldNode(
name: NameNode(value: 'nodes'),
alias: null,

View File

@ -290,6 +290,7 @@ Map<String, dynamic> _$RepositoryInfoToJson(RepositoryInfo instance) =>
PinnableItemConnection _$PinnableItemConnectionFromJson(
Map<String, dynamic> json) {
return PinnableItemConnection()
..totalCount = json['totalCount'] as int
..nodes = (json['nodes'] as List)
?.map((e) =>
e == null ? null : PinnableItem.fromJson(e as Map<String, dynamic>))
@ -299,6 +300,7 @@ PinnableItemConnection _$PinnableItemConnectionFromJson(
Map<String, dynamic> _$PinnableItemConnectionToJson(
PinnableItemConnection instance) =>
<String, dynamic>{
'totalCount': instance.totalCount,
'nodes': instance.nodes?.map((e) => e?.toJson())?.toList(),
};

View File

@ -48,6 +48,7 @@ query($login: String!) {
}
}
pinnedItems(first: 6) {
totalCount # TODO: Add this for correct generated code
nodes {
... on Repository {
owner {

View File

@ -180,8 +180,7 @@ class UserScreen extends StatelessWidget {
CommonStyle.border,
Row(children: [
EntryItem(
// count: payload.pinnableItems.totalCount,
count: 0, // TODO:
count: payload.pinnableItems.totalCount,
text: 'Repositories',
screenBuilder: (context) =>
RepositoriesScreen.ofOrganization(payload.login),