fix: commit status

This commit is contained in:
Rongjian Zhang
2020-01-03 14:47:07 +08:00
parent ac27c704d2
commit bd9703e443
5 changed files with 142 additions and 17 deletions

View File

@@ -123,6 +123,8 @@ class GithubCommitsCommit extends GithubCommitsPullRequestTimelineItem
GithubCommitsGitActor author;
GithubCommitsStatus status;
GithubCommitsCommitHistoryConnection history;
@override
@@ -130,8 +132,16 @@ class GithubCommitsCommit extends GithubCommitsPullRequestTimelineItem
String resolveType;
@override
List<Object> get props =>
[oid, url, messageHeadline, committedDate, author, history, resolveType];
List<Object> get props => [
oid,
url,
messageHeadline,
committedDate,
author,
status,
history,
resolveType
];
Map<String, dynamic> toJson() => _$GithubCommitsCommitToJson(this);
}
@@ -342,6 +352,24 @@ class GithubCommitsSponsorable with EquatableMixin {
Map<String, dynamic> toJson() => _$GithubCommitsSponsorableToJson(this);
}
@JsonSerializable(explicitToJson: true)
class GithubCommitsStatus with EquatableMixin implements GithubCommitsNode {
GithubCommitsStatus();
factory GithubCommitsStatus.fromJson(Map<String, dynamic> json) =>
_$GithubCommitsStatusFromJson(json);
GithubCommitsStatusState state;
@override
@JsonKey(name: '__typename')
String resolveType;
@override
List<Object> get props => [state, resolveType];
Map<String, dynamic> toJson() => _$GithubCommitsStatusToJson(this);
}
@JsonSerializable(explicitToJson: true)
class GithubCommitsCommitHistoryConnection with EquatableMixin {
GithubCommitsCommitHistoryConnection();
@@ -447,6 +475,14 @@ class GithubCommitsRepositoryInfo with EquatableMixin {
Map<String, dynamic> toJson() => _$GithubCommitsRepositoryInfoToJson(this);
}
enum GithubCommitsStatusState {
EXPECTED,
ERROR,
FAILURE,
PENDING,
SUCCESS,
}
@JsonSerializable(explicitToJson: true)
class GithubCommitsArguments extends JsonSerializable with EquatableMixin {
GithubCommitsArguments(
@@ -556,6 +592,19 @@ class GithubCommitsQuery
selectionSet: null)
]))
])),
FieldNode(
name: NameNode(value: 'status'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'state'),
alias: null,
arguments: [],
directives: [],
selectionSet: null)
])),
FieldNode(
name: NameNode(value: 'history'),
alias: null,
@@ -653,6 +702,20 @@ class GithubCommitsQuery
directives: [],
selectionSet: null)
]))
])),
FieldNode(
name: NameNode(value: 'status'),
alias: null,
arguments: [],
directives: [],
selectionSet:
SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'state'),
alias: null,
arguments: [],
directives: [],
selectionSet: null)
]))
]))
]))