mirror of
https://github.com/git-touch/git-touch
synced 2025-01-31 08:04:51 +01:00
refactor: create issue api
This commit is contained in:
parent
857e49f220
commit
4551b6e9fd
@ -7167,3 +7167,795 @@ class GhUnfollowUserQuery
|
||||
GhUnfollowUser parse(Map<String, dynamic> json) =>
|
||||
GhUnfollowUser.fromJson(json);
|
||||
}
|
||||
|
||||
@JsonSerializable(explicitToJson: true)
|
||||
class GhCreateIssue with EquatableMixin {
|
||||
GhCreateIssue();
|
||||
|
||||
factory GhCreateIssue.fromJson(Map<String, dynamic> json) =>
|
||||
_$GhCreateIssueFromJson(json);
|
||||
|
||||
GhCreateIssueCreateIssuePayload createIssue;
|
||||
|
||||
@override
|
||||
List<Object> get props => [createIssue];
|
||||
Map<String, dynamic> toJson() => _$GhCreateIssueToJson(this);
|
||||
}
|
||||
|
||||
@JsonSerializable(explicitToJson: true)
|
||||
class GhCreateIssueCreateIssuePayload with EquatableMixin {
|
||||
GhCreateIssueCreateIssuePayload();
|
||||
|
||||
factory GhCreateIssueCreateIssuePayload.fromJson(Map<String, dynamic> json) =>
|
||||
_$GhCreateIssueCreateIssuePayloadFromJson(json);
|
||||
|
||||
GhCreateIssueIssue issue;
|
||||
|
||||
@override
|
||||
List<Object> get props => [issue];
|
||||
Map<String, dynamic> toJson() =>
|
||||
_$GhCreateIssueCreateIssuePayloadToJson(this);
|
||||
}
|
||||
|
||||
@JsonSerializable(explicitToJson: true)
|
||||
class GhCreateIssueIssue extends GhCreateIssueProjectCardItem
|
||||
with EquatableMixin
|
||||
implements
|
||||
GhCreateIssueNode,
|
||||
GhCreateIssueAssignable,
|
||||
GhCreateIssueClosable,
|
||||
GhCreateIssueComment,
|
||||
GhCreateIssueUpdatable,
|
||||
GhCreateIssueUpdatableComment,
|
||||
GhCreateIssueLabelable,
|
||||
GhCreateIssueLockable,
|
||||
GhCreateIssueReactable,
|
||||
GhCreateIssueRepositoryNode,
|
||||
GhCreateIssueSubscribable,
|
||||
GhCreateIssueUniformResourceLocatable {
|
||||
GhCreateIssueIssue();
|
||||
|
||||
factory GhCreateIssueIssue.fromJson(Map<String, dynamic> json) =>
|
||||
_$GhCreateIssueIssueFromJson(json);
|
||||
|
||||
int number;
|
||||
|
||||
@override
|
||||
GhCreateIssueRepository repository;
|
||||
|
||||
@override
|
||||
@JsonKey(name: '__typename')
|
||||
String resolveType;
|
||||
|
||||
@override
|
||||
List<Object> get props => [number, repository, resolveType];
|
||||
Map<String, dynamic> toJson() => _$GhCreateIssueIssueToJson(this);
|
||||
}
|
||||
|
||||
@JsonSerializable(explicitToJson: true)
|
||||
class GhCreateIssueRepository extends GhCreateIssuePinnableItem
|
||||
with EquatableMixin
|
||||
implements
|
||||
GhCreateIssueNode,
|
||||
GhCreateIssueProjectOwner,
|
||||
GhCreateIssueRegistryPackageOwner,
|
||||
GhCreateIssueRegistryPackageSearch,
|
||||
GhCreateIssueSubscribable,
|
||||
GhCreateIssueStarrable,
|
||||
GhCreateIssueUniformResourceLocatable,
|
||||
GhCreateIssueRepositoryInfo {
|
||||
GhCreateIssueRepository();
|
||||
|
||||
factory GhCreateIssueRepository.fromJson(Map<String, dynamic> json) =>
|
||||
_$GhCreateIssueRepositoryFromJson(json);
|
||||
|
||||
@override
|
||||
GhCreateIssueRepositoryOwner owner;
|
||||
|
||||
@override
|
||||
String name;
|
||||
|
||||
@override
|
||||
@JsonKey(name: '__typename')
|
||||
String resolveType;
|
||||
|
||||
@override
|
||||
List<Object> get props => [owner, name, resolveType];
|
||||
Map<String, dynamic> toJson() => _$GhCreateIssueRepositoryToJson(this);
|
||||
}
|
||||
|
||||
@JsonSerializable(explicitToJson: true)
|
||||
class GhCreateIssueRepositoryOwner with EquatableMixin {
|
||||
GhCreateIssueRepositoryOwner();
|
||||
|
||||
factory GhCreateIssueRepositoryOwner.fromJson(Map<String, dynamic> json) =>
|
||||
_$GhCreateIssueRepositoryOwnerFromJson(json);
|
||||
|
||||
String login;
|
||||
|
||||
@JsonKey(name: '__typename')
|
||||
String resolveType;
|
||||
|
||||
@override
|
||||
List<Object> get props => [login, resolveType];
|
||||
Map<String, dynamic> toJson() => _$GhCreateIssueRepositoryOwnerToJson(this);
|
||||
}
|
||||
|
||||
@JsonSerializable(explicitToJson: true)
|
||||
class GhCreateIssuePinnableItem with EquatableMixin {
|
||||
GhCreateIssuePinnableItem();
|
||||
|
||||
factory GhCreateIssuePinnableItem.fromJson(Map<String, dynamic> json) =>
|
||||
_$GhCreateIssuePinnableItemFromJson(json);
|
||||
|
||||
@override
|
||||
List<Object> get props => [];
|
||||
Map<String, dynamic> toJson() => _$GhCreateIssuePinnableItemToJson(this);
|
||||
}
|
||||
|
||||
@JsonSerializable(explicitToJson: true)
|
||||
class GhCreateIssueNode with EquatableMixin {
|
||||
GhCreateIssueNode();
|
||||
|
||||
factory GhCreateIssueNode.fromJson(Map<String, dynamic> json) =>
|
||||
_$GhCreateIssueNodeFromJson(json);
|
||||
|
||||
@JsonKey(name: '__typename')
|
||||
String resolveType;
|
||||
|
||||
@override
|
||||
List<Object> get props => [resolveType];
|
||||
Map<String, dynamic> toJson() => _$GhCreateIssueNodeToJson(this);
|
||||
}
|
||||
|
||||
@JsonSerializable(explicitToJson: true)
|
||||
class GhCreateIssueProjectOwner with EquatableMixin {
|
||||
GhCreateIssueProjectOwner();
|
||||
|
||||
factory GhCreateIssueProjectOwner.fromJson(Map<String, dynamic> json) =>
|
||||
_$GhCreateIssueProjectOwnerFromJson(json);
|
||||
|
||||
@JsonKey(name: '__typename')
|
||||
String resolveType;
|
||||
|
||||
@override
|
||||
List<Object> get props => [resolveType];
|
||||
Map<String, dynamic> toJson() => _$GhCreateIssueProjectOwnerToJson(this);
|
||||
}
|
||||
|
||||
@JsonSerializable(explicitToJson: true)
|
||||
class GhCreateIssueRegistryPackageOwner with EquatableMixin {
|
||||
GhCreateIssueRegistryPackageOwner();
|
||||
|
||||
factory GhCreateIssueRegistryPackageOwner.fromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
_$GhCreateIssueRegistryPackageOwnerFromJson(json);
|
||||
|
||||
@JsonKey(name: '__typename')
|
||||
String resolveType;
|
||||
|
||||
@override
|
||||
List<Object> get props => [resolveType];
|
||||
Map<String, dynamic> toJson() =>
|
||||
_$GhCreateIssueRegistryPackageOwnerToJson(this);
|
||||
}
|
||||
|
||||
@JsonSerializable(explicitToJson: true)
|
||||
class GhCreateIssueRegistryPackageSearch with EquatableMixin {
|
||||
GhCreateIssueRegistryPackageSearch();
|
||||
|
||||
factory GhCreateIssueRegistryPackageSearch.fromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
_$GhCreateIssueRegistryPackageSearchFromJson(json);
|
||||
|
||||
@JsonKey(name: '__typename')
|
||||
String resolveType;
|
||||
|
||||
@override
|
||||
List<Object> get props => [resolveType];
|
||||
Map<String, dynamic> toJson() =>
|
||||
_$GhCreateIssueRegistryPackageSearchToJson(this);
|
||||
}
|
||||
|
||||
@JsonSerializable(explicitToJson: true)
|
||||
class GhCreateIssueSubscribable with EquatableMixin {
|
||||
GhCreateIssueSubscribable();
|
||||
|
||||
factory GhCreateIssueSubscribable.fromJson(Map<String, dynamic> json) =>
|
||||
_$GhCreateIssueSubscribableFromJson(json);
|
||||
|
||||
@JsonKey(name: '__typename')
|
||||
String resolveType;
|
||||
|
||||
@override
|
||||
List<Object> get props => [resolveType];
|
||||
Map<String, dynamic> toJson() => _$GhCreateIssueSubscribableToJson(this);
|
||||
}
|
||||
|
||||
@JsonSerializable(explicitToJson: true)
|
||||
class GhCreateIssueStarrable with EquatableMixin {
|
||||
GhCreateIssueStarrable();
|
||||
|
||||
factory GhCreateIssueStarrable.fromJson(Map<String, dynamic> json) =>
|
||||
_$GhCreateIssueStarrableFromJson(json);
|
||||
|
||||
@JsonKey(name: '__typename')
|
||||
String resolveType;
|
||||
|
||||
@override
|
||||
List<Object> get props => [resolveType];
|
||||
Map<String, dynamic> toJson() => _$GhCreateIssueStarrableToJson(this);
|
||||
}
|
||||
|
||||
@JsonSerializable(explicitToJson: true)
|
||||
class GhCreateIssueUniformResourceLocatable with EquatableMixin {
|
||||
GhCreateIssueUniformResourceLocatable();
|
||||
|
||||
factory GhCreateIssueUniformResourceLocatable.fromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
_$GhCreateIssueUniformResourceLocatableFromJson(json);
|
||||
|
||||
@JsonKey(name: '__typename')
|
||||
String resolveType;
|
||||
|
||||
@override
|
||||
List<Object> get props => [resolveType];
|
||||
Map<String, dynamic> toJson() =>
|
||||
_$GhCreateIssueUniformResourceLocatableToJson(this);
|
||||
}
|
||||
|
||||
@JsonSerializable(explicitToJson: true)
|
||||
class GhCreateIssueRepositoryInfo with EquatableMixin {
|
||||
GhCreateIssueRepositoryInfo();
|
||||
|
||||
factory GhCreateIssueRepositoryInfo.fromJson(Map<String, dynamic> json) =>
|
||||
_$GhCreateIssueRepositoryInfoFromJson(json);
|
||||
|
||||
GhCreateIssueRepositoryOwner owner;
|
||||
|
||||
String name;
|
||||
|
||||
@JsonKey(name: '__typename')
|
||||
String resolveType;
|
||||
|
||||
@override
|
||||
List<Object> get props => [owner, name, resolveType];
|
||||
Map<String, dynamic> toJson() => _$GhCreateIssueRepositoryInfoToJson(this);
|
||||
}
|
||||
|
||||
@JsonSerializable(explicitToJson: true)
|
||||
class GhCreateIssueProjectCardItem with EquatableMixin {
|
||||
GhCreateIssueProjectCardItem();
|
||||
|
||||
factory GhCreateIssueProjectCardItem.fromJson(Map<String, dynamic> json) =>
|
||||
_$GhCreateIssueProjectCardItemFromJson(json);
|
||||
|
||||
@override
|
||||
List<Object> get props => [];
|
||||
Map<String, dynamic> toJson() => _$GhCreateIssueProjectCardItemToJson(this);
|
||||
}
|
||||
|
||||
@JsonSerializable(explicitToJson: true)
|
||||
class GhCreateIssueAssignable with EquatableMixin {
|
||||
GhCreateIssueAssignable();
|
||||
|
||||
factory GhCreateIssueAssignable.fromJson(Map<String, dynamic> json) =>
|
||||
_$GhCreateIssueAssignableFromJson(json);
|
||||
|
||||
@JsonKey(name: '__typename')
|
||||
String resolveType;
|
||||
|
||||
@override
|
||||
List<Object> get props => [resolveType];
|
||||
Map<String, dynamic> toJson() => _$GhCreateIssueAssignableToJson(this);
|
||||
}
|
||||
|
||||
@JsonSerializable(explicitToJson: true)
|
||||
class GhCreateIssueClosable with EquatableMixin {
|
||||
GhCreateIssueClosable();
|
||||
|
||||
factory GhCreateIssueClosable.fromJson(Map<String, dynamic> json) =>
|
||||
_$GhCreateIssueClosableFromJson(json);
|
||||
|
||||
@JsonKey(name: '__typename')
|
||||
String resolveType;
|
||||
|
||||
@override
|
||||
List<Object> get props => [resolveType];
|
||||
Map<String, dynamic> toJson() => _$GhCreateIssueClosableToJson(this);
|
||||
}
|
||||
|
||||
@JsonSerializable(explicitToJson: true)
|
||||
class GhCreateIssueComment with EquatableMixin {
|
||||
GhCreateIssueComment();
|
||||
|
||||
factory GhCreateIssueComment.fromJson(Map<String, dynamic> json) =>
|
||||
_$GhCreateIssueCommentFromJson(json);
|
||||
|
||||
@JsonKey(name: '__typename')
|
||||
String resolveType;
|
||||
|
||||
@override
|
||||
List<Object> get props => [resolveType];
|
||||
Map<String, dynamic> toJson() => _$GhCreateIssueCommentToJson(this);
|
||||
}
|
||||
|
||||
@JsonSerializable(explicitToJson: true)
|
||||
class GhCreateIssueUpdatable with EquatableMixin {
|
||||
GhCreateIssueUpdatable();
|
||||
|
||||
factory GhCreateIssueUpdatable.fromJson(Map<String, dynamic> json) =>
|
||||
_$GhCreateIssueUpdatableFromJson(json);
|
||||
|
||||
@JsonKey(name: '__typename')
|
||||
String resolveType;
|
||||
|
||||
@override
|
||||
List<Object> get props => [resolveType];
|
||||
Map<String, dynamic> toJson() => _$GhCreateIssueUpdatableToJson(this);
|
||||
}
|
||||
|
||||
@JsonSerializable(explicitToJson: true)
|
||||
class GhCreateIssueUpdatableComment with EquatableMixin {
|
||||
GhCreateIssueUpdatableComment();
|
||||
|
||||
factory GhCreateIssueUpdatableComment.fromJson(Map<String, dynamic> json) =>
|
||||
_$GhCreateIssueUpdatableCommentFromJson(json);
|
||||
|
||||
@JsonKey(name: '__typename')
|
||||
String resolveType;
|
||||
|
||||
@override
|
||||
List<Object> get props => [resolveType];
|
||||
Map<String, dynamic> toJson() => _$GhCreateIssueUpdatableCommentToJson(this);
|
||||
}
|
||||
|
||||
@JsonSerializable(explicitToJson: true)
|
||||
class GhCreateIssueLabelable with EquatableMixin {
|
||||
GhCreateIssueLabelable();
|
||||
|
||||
factory GhCreateIssueLabelable.fromJson(Map<String, dynamic> json) =>
|
||||
_$GhCreateIssueLabelableFromJson(json);
|
||||
|
||||
@JsonKey(name: '__typename')
|
||||
String resolveType;
|
||||
|
||||
@override
|
||||
List<Object> get props => [resolveType];
|
||||
Map<String, dynamic> toJson() => _$GhCreateIssueLabelableToJson(this);
|
||||
}
|
||||
|
||||
@JsonSerializable(explicitToJson: true)
|
||||
class GhCreateIssueLockable with EquatableMixin {
|
||||
GhCreateIssueLockable();
|
||||
|
||||
factory GhCreateIssueLockable.fromJson(Map<String, dynamic> json) =>
|
||||
_$GhCreateIssueLockableFromJson(json);
|
||||
|
||||
@JsonKey(name: '__typename')
|
||||
String resolveType;
|
||||
|
||||
@override
|
||||
List<Object> get props => [resolveType];
|
||||
Map<String, dynamic> toJson() => _$GhCreateIssueLockableToJson(this);
|
||||
}
|
||||
|
||||
@JsonSerializable(explicitToJson: true)
|
||||
class GhCreateIssueReactable with EquatableMixin {
|
||||
GhCreateIssueReactable();
|
||||
|
||||
factory GhCreateIssueReactable.fromJson(Map<String, dynamic> json) =>
|
||||
_$GhCreateIssueReactableFromJson(json);
|
||||
|
||||
@JsonKey(name: '__typename')
|
||||
String resolveType;
|
||||
|
||||
@override
|
||||
List<Object> get props => [resolveType];
|
||||
Map<String, dynamic> toJson() => _$GhCreateIssueReactableToJson(this);
|
||||
}
|
||||
|
||||
@JsonSerializable(explicitToJson: true)
|
||||
class GhCreateIssueRepositoryNode with EquatableMixin {
|
||||
GhCreateIssueRepositoryNode();
|
||||
|
||||
factory GhCreateIssueRepositoryNode.fromJson(Map<String, dynamic> json) =>
|
||||
_$GhCreateIssueRepositoryNodeFromJson(json);
|
||||
|
||||
GhCreateIssueRepository repository;
|
||||
|
||||
@JsonKey(name: '__typename')
|
||||
String resolveType;
|
||||
|
||||
@override
|
||||
List<Object> get props => [repository, resolveType];
|
||||
Map<String, dynamic> toJson() => _$GhCreateIssueRepositoryNodeToJson(this);
|
||||
}
|
||||
|
||||
@JsonSerializable(explicitToJson: true)
|
||||
class GhCreateIssueArguments extends JsonSerializable with EquatableMixin {
|
||||
GhCreateIssueArguments({this.repoId, this.title, this.body});
|
||||
|
||||
factory GhCreateIssueArguments.fromJson(Map<String, dynamic> json) =>
|
||||
_$GhCreateIssueArgumentsFromJson(json);
|
||||
|
||||
final String repoId;
|
||||
|
||||
final String title;
|
||||
|
||||
final String body;
|
||||
|
||||
@override
|
||||
List<Object> get props => [repoId, title, body];
|
||||
Map<String, dynamic> toJson() => _$GhCreateIssueArgumentsToJson(this);
|
||||
}
|
||||
|
||||
class GhCreateIssueQuery
|
||||
extends GraphQLQuery<GhCreateIssue, GhCreateIssueArguments> {
|
||||
GhCreateIssueQuery({this.variables});
|
||||
|
||||
@override
|
||||
final DocumentNode document = DocumentNode(definitions: [
|
||||
OperationDefinitionNode(
|
||||
type: OperationType.mutation,
|
||||
name: NameNode(value: 'GhCreateIssue'),
|
||||
variableDefinitions: [
|
||||
VariableDefinitionNode(
|
||||
variable: VariableNode(name: NameNode(value: 'repoId')),
|
||||
type: NamedTypeNode(name: NameNode(value: 'ID'), isNonNull: true),
|
||||
defaultValue: DefaultValueNode(value: null),
|
||||
directives: []),
|
||||
VariableDefinitionNode(
|
||||
variable: VariableNode(name: NameNode(value: 'title')),
|
||||
type: NamedTypeNode(
|
||||
name: NameNode(value: 'String'), isNonNull: true),
|
||||
defaultValue: DefaultValueNode(value: null),
|
||||
directives: []),
|
||||
VariableDefinitionNode(
|
||||
variable: VariableNode(name: NameNode(value: 'body')),
|
||||
type: NamedTypeNode(
|
||||
name: NameNode(value: 'String'), isNonNull: true),
|
||||
defaultValue: DefaultValueNode(value: null),
|
||||
directives: [])
|
||||
],
|
||||
directives: [],
|
||||
selectionSet: SelectionSetNode(selections: [
|
||||
FieldNode(
|
||||
name: NameNode(value: 'createIssue'),
|
||||
alias: null,
|
||||
arguments: [
|
||||
ArgumentNode(
|
||||
name: NameNode(value: 'input'),
|
||||
value: ObjectValueNode(fields: [
|
||||
ObjectFieldNode(
|
||||
name: NameNode(value: 'repositoryId'),
|
||||
value: VariableNode(name: NameNode(value: 'repoId'))),
|
||||
ObjectFieldNode(
|
||||
name: NameNode(value: 'title'),
|
||||
value: VariableNode(name: NameNode(value: 'title'))),
|
||||
ObjectFieldNode(
|
||||
name: NameNode(value: 'body'),
|
||||
value: VariableNode(name: NameNode(value: 'body')))
|
||||
]))
|
||||
],
|
||||
directives: [],
|
||||
selectionSet: SelectionSetNode(selections: [
|
||||
FieldNode(
|
||||
name: NameNode(value: 'issue'),
|
||||
alias: null,
|
||||
arguments: [],
|
||||
directives: [],
|
||||
selectionSet: SelectionSetNode(selections: [
|
||||
FieldNode(
|
||||
name: NameNode(value: 'number'),
|
||||
alias: null,
|
||||
arguments: [],
|
||||
directives: [],
|
||||
selectionSet: null),
|
||||
FieldNode(
|
||||
name: NameNode(value: 'repository'),
|
||||
alias: null,
|
||||
arguments: [],
|
||||
directives: [],
|
||||
selectionSet: SelectionSetNode(selections: [
|
||||
FieldNode(
|
||||
name: NameNode(value: 'owner'),
|
||||
alias: null,
|
||||
arguments: [],
|
||||
directives: [],
|
||||
selectionSet: SelectionSetNode(selections: [
|
||||
FieldNode(
|
||||
name: NameNode(value: 'login'),
|
||||
alias: null,
|
||||
arguments: [],
|
||||
directives: [],
|
||||
selectionSet: null)
|
||||
])),
|
||||
FieldNode(
|
||||
name: NameNode(value: 'name'),
|
||||
alias: null,
|
||||
arguments: [],
|
||||
directives: [],
|
||||
selectionSet: null)
|
||||
]))
|
||||
]))
|
||||
]))
|
||||
]))
|
||||
]);
|
||||
|
||||
@override
|
||||
final String operationName = 'GhCreateIssue';
|
||||
|
||||
@override
|
||||
final GhCreateIssueArguments variables;
|
||||
|
||||
@override
|
||||
List<Object> get props => [document, operationName, variables];
|
||||
@override
|
||||
GhCreateIssue parse(Map<String, dynamic> json) =>
|
||||
GhCreateIssue.fromJson(json);
|
||||
}
|
||||
|
||||
@JsonSerializable(explicitToJson: true)
|
||||
class GhRepoId with EquatableMixin {
|
||||
GhRepoId();
|
||||
|
||||
factory GhRepoId.fromJson(Map<String, dynamic> json) =>
|
||||
_$GhRepoIdFromJson(json);
|
||||
|
||||
GhRepoIdRepository repository;
|
||||
|
||||
@override
|
||||
List<Object> get props => [repository];
|
||||
Map<String, dynamic> toJson() => _$GhRepoIdToJson(this);
|
||||
}
|
||||
|
||||
@JsonSerializable(explicitToJson: true)
|
||||
class GhRepoIdRepository extends GhRepoIdPinnableItem
|
||||
with EquatableMixin
|
||||
implements
|
||||
GhRepoIdNode,
|
||||
GhRepoIdProjectOwner,
|
||||
GhRepoIdRegistryPackageOwner,
|
||||
GhRepoIdRegistryPackageSearch,
|
||||
GhRepoIdSubscribable,
|
||||
GhRepoIdStarrable,
|
||||
GhRepoIdUniformResourceLocatable,
|
||||
GhRepoIdRepositoryInfo {
|
||||
GhRepoIdRepository();
|
||||
|
||||
factory GhRepoIdRepository.fromJson(Map<String, dynamic> json) =>
|
||||
_$GhRepoIdRepositoryFromJson(json);
|
||||
|
||||
@override
|
||||
String id;
|
||||
|
||||
@override
|
||||
@JsonKey(name: '__typename')
|
||||
String resolveType;
|
||||
|
||||
@override
|
||||
List<Object> get props => [id, resolveType];
|
||||
Map<String, dynamic> toJson() => _$GhRepoIdRepositoryToJson(this);
|
||||
}
|
||||
|
||||
@JsonSerializable(explicitToJson: true)
|
||||
class GhRepoIdPinnableItem with EquatableMixin {
|
||||
GhRepoIdPinnableItem();
|
||||
|
||||
factory GhRepoIdPinnableItem.fromJson(Map<String, dynamic> json) =>
|
||||
_$GhRepoIdPinnableItemFromJson(json);
|
||||
|
||||
@override
|
||||
List<Object> get props => [];
|
||||
Map<String, dynamic> toJson() => _$GhRepoIdPinnableItemToJson(this);
|
||||
}
|
||||
|
||||
@JsonSerializable(explicitToJson: true)
|
||||
class GhRepoIdNode with EquatableMixin {
|
||||
GhRepoIdNode();
|
||||
|
||||
factory GhRepoIdNode.fromJson(Map<String, dynamic> json) =>
|
||||
_$GhRepoIdNodeFromJson(json);
|
||||
|
||||
String id;
|
||||
|
||||
@JsonKey(name: '__typename')
|
||||
String resolveType;
|
||||
|
||||
@override
|
||||
List<Object> get props => [id, resolveType];
|
||||
Map<String, dynamic> toJson() => _$GhRepoIdNodeToJson(this);
|
||||
}
|
||||
|
||||
@JsonSerializable(explicitToJson: true)
|
||||
class GhRepoIdProjectOwner with EquatableMixin {
|
||||
GhRepoIdProjectOwner();
|
||||
|
||||
factory GhRepoIdProjectOwner.fromJson(Map<String, dynamic> json) =>
|
||||
_$GhRepoIdProjectOwnerFromJson(json);
|
||||
|
||||
String id;
|
||||
|
||||
@JsonKey(name: '__typename')
|
||||
String resolveType;
|
||||
|
||||
@override
|
||||
List<Object> get props => [id, resolveType];
|
||||
Map<String, dynamic> toJson() => _$GhRepoIdProjectOwnerToJson(this);
|
||||
}
|
||||
|
||||
@JsonSerializable(explicitToJson: true)
|
||||
class GhRepoIdRegistryPackageOwner with EquatableMixin {
|
||||
GhRepoIdRegistryPackageOwner();
|
||||
|
||||
factory GhRepoIdRegistryPackageOwner.fromJson(Map<String, dynamic> json) =>
|
||||
_$GhRepoIdRegistryPackageOwnerFromJson(json);
|
||||
|
||||
String id;
|
||||
|
||||
@JsonKey(name: '__typename')
|
||||
String resolveType;
|
||||
|
||||
@override
|
||||
List<Object> get props => [id, resolveType];
|
||||
Map<String, dynamic> toJson() => _$GhRepoIdRegistryPackageOwnerToJson(this);
|
||||
}
|
||||
|
||||
@JsonSerializable(explicitToJson: true)
|
||||
class GhRepoIdRegistryPackageSearch with EquatableMixin {
|
||||
GhRepoIdRegistryPackageSearch();
|
||||
|
||||
factory GhRepoIdRegistryPackageSearch.fromJson(Map<String, dynamic> json) =>
|
||||
_$GhRepoIdRegistryPackageSearchFromJson(json);
|
||||
|
||||
String id;
|
||||
|
||||
@JsonKey(name: '__typename')
|
||||
String resolveType;
|
||||
|
||||
@override
|
||||
List<Object> get props => [id, resolveType];
|
||||
Map<String, dynamic> toJson() => _$GhRepoIdRegistryPackageSearchToJson(this);
|
||||
}
|
||||
|
||||
@JsonSerializable(explicitToJson: true)
|
||||
class GhRepoIdSubscribable with EquatableMixin {
|
||||
GhRepoIdSubscribable();
|
||||
|
||||
factory GhRepoIdSubscribable.fromJson(Map<String, dynamic> json) =>
|
||||
_$GhRepoIdSubscribableFromJson(json);
|
||||
|
||||
String id;
|
||||
|
||||
@JsonKey(name: '__typename')
|
||||
String resolveType;
|
||||
|
||||
@override
|
||||
List<Object> get props => [id, resolveType];
|
||||
Map<String, dynamic> toJson() => _$GhRepoIdSubscribableToJson(this);
|
||||
}
|
||||
|
||||
@JsonSerializable(explicitToJson: true)
|
||||
class GhRepoIdStarrable with EquatableMixin {
|
||||
GhRepoIdStarrable();
|
||||
|
||||
factory GhRepoIdStarrable.fromJson(Map<String, dynamic> json) =>
|
||||
_$GhRepoIdStarrableFromJson(json);
|
||||
|
||||
String id;
|
||||
|
||||
@JsonKey(name: '__typename')
|
||||
String resolveType;
|
||||
|
||||
@override
|
||||
List<Object> get props => [id, resolveType];
|
||||
Map<String, dynamic> toJson() => _$GhRepoIdStarrableToJson(this);
|
||||
}
|
||||
|
||||
@JsonSerializable(explicitToJson: true)
|
||||
class GhRepoIdUniformResourceLocatable with EquatableMixin {
|
||||
GhRepoIdUniformResourceLocatable();
|
||||
|
||||
factory GhRepoIdUniformResourceLocatable.fromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
_$GhRepoIdUniformResourceLocatableFromJson(json);
|
||||
|
||||
@JsonKey(name: '__typename')
|
||||
String resolveType;
|
||||
|
||||
@override
|
||||
List<Object> get props => [resolveType];
|
||||
Map<String, dynamic> toJson() =>
|
||||
_$GhRepoIdUniformResourceLocatableToJson(this);
|
||||
}
|
||||
|
||||
@JsonSerializable(explicitToJson: true)
|
||||
class GhRepoIdRepositoryInfo with EquatableMixin {
|
||||
GhRepoIdRepositoryInfo();
|
||||
|
||||
factory GhRepoIdRepositoryInfo.fromJson(Map<String, dynamic> json) =>
|
||||
_$GhRepoIdRepositoryInfoFromJson(json);
|
||||
|
||||
@JsonKey(name: '__typename')
|
||||
String resolveType;
|
||||
|
||||
@override
|
||||
List<Object> get props => [resolveType];
|
||||
Map<String, dynamic> toJson() => _$GhRepoIdRepositoryInfoToJson(this);
|
||||
}
|
||||
|
||||
@JsonSerializable(explicitToJson: true)
|
||||
class GhRepoIdArguments extends JsonSerializable with EquatableMixin {
|
||||
GhRepoIdArguments({this.owner, this.name});
|
||||
|
||||
factory GhRepoIdArguments.fromJson(Map<String, dynamic> json) =>
|
||||
_$GhRepoIdArgumentsFromJson(json);
|
||||
|
||||
final String owner;
|
||||
|
||||
final String name;
|
||||
|
||||
@override
|
||||
List<Object> get props => [owner, name];
|
||||
Map<String, dynamic> toJson() => _$GhRepoIdArgumentsToJson(this);
|
||||
}
|
||||
|
||||
class GhRepoIdQuery extends GraphQLQuery<GhRepoId, GhRepoIdArguments> {
|
||||
GhRepoIdQuery({this.variables});
|
||||
|
||||
@override
|
||||
final DocumentNode document = DocumentNode(definitions: [
|
||||
OperationDefinitionNode(
|
||||
type: OperationType.query,
|
||||
name: NameNode(value: 'GhRepoId'),
|
||||
variableDefinitions: [
|
||||
VariableDefinitionNode(
|
||||
variable: VariableNode(name: NameNode(value: 'owner')),
|
||||
type: NamedTypeNode(
|
||||
name: NameNode(value: 'String'), isNonNull: true),
|
||||
defaultValue: DefaultValueNode(value: null),
|
||||
directives: []),
|
||||
VariableDefinitionNode(
|
||||
variable: VariableNode(name: NameNode(value: 'name')),
|
||||
type: NamedTypeNode(
|
||||
name: NameNode(value: 'String'), isNonNull: true),
|
||||
defaultValue: DefaultValueNode(value: null),
|
||||
directives: [])
|
||||
],
|
||||
directives: [],
|
||||
selectionSet: SelectionSetNode(selections: [
|
||||
FieldNode(
|
||||
name: NameNode(value: 'repository'),
|
||||
alias: null,
|
||||
arguments: [
|
||||
ArgumentNode(
|
||||
name: NameNode(value: 'owner'),
|
||||
value: VariableNode(name: NameNode(value: 'owner'))),
|
||||
ArgumentNode(
|
||||
name: NameNode(value: 'name'),
|
||||
value: VariableNode(name: NameNode(value: 'name')))
|
||||
],
|
||||
directives: [],
|
||||
selectionSet: SelectionSetNode(selections: [
|
||||
FieldNode(
|
||||
name: NameNode(value: 'id'),
|
||||
alias: null,
|
||||
arguments: [],
|
||||
directives: [],
|
||||
selectionSet: null)
|
||||
]))
|
||||
]))
|
||||
]);
|
||||
|
||||
@override
|
||||
final String operationName = 'GhRepoId';
|
||||
|
||||
@override
|
||||
final GhRepoIdArguments variables;
|
||||
|
||||
@override
|
||||
List<Object> get props => [document, operationName, variables];
|
||||
@override
|
||||
GhRepoId parse(Map<String, dynamic> json) => GhRepoId.fromJson(json);
|
||||
}
|
||||
|
@ -2855,3 +2855,465 @@ Map<String, dynamic> _$GhUnfollowUserArgumentsToJson(
|
||||
<String, dynamic>{
|
||||
'id': instance.id,
|
||||
};
|
||||
|
||||
GhCreateIssue _$GhCreateIssueFromJson(Map<String, dynamic> json) {
|
||||
return GhCreateIssue()
|
||||
..createIssue = json['createIssue'] == null
|
||||
? null
|
||||
: GhCreateIssueCreateIssuePayload.fromJson(
|
||||
json['createIssue'] as Map<String, dynamic>);
|
||||
}
|
||||
|
||||
Map<String, dynamic> _$GhCreateIssueToJson(GhCreateIssue instance) =>
|
||||
<String, dynamic>{
|
||||
'createIssue': instance.createIssue?.toJson(),
|
||||
};
|
||||
|
||||
GhCreateIssueCreateIssuePayload _$GhCreateIssueCreateIssuePayloadFromJson(
|
||||
Map<String, dynamic> json) {
|
||||
return GhCreateIssueCreateIssuePayload()
|
||||
..issue = json['issue'] == null
|
||||
? null
|
||||
: GhCreateIssueIssue.fromJson(json['issue'] as Map<String, dynamic>);
|
||||
}
|
||||
|
||||
Map<String, dynamic> _$GhCreateIssueCreateIssuePayloadToJson(
|
||||
GhCreateIssueCreateIssuePayload instance) =>
|
||||
<String, dynamic>{
|
||||
'issue': instance.issue?.toJson(),
|
||||
};
|
||||
|
||||
GhCreateIssueIssue _$GhCreateIssueIssueFromJson(Map<String, dynamic> json) {
|
||||
return GhCreateIssueIssue()
|
||||
..number = json['number'] as int
|
||||
..repository = json['repository'] == null
|
||||
? null
|
||||
: GhCreateIssueRepository.fromJson(
|
||||
json['repository'] as Map<String, dynamic>)
|
||||
..resolveType = json['__typename'] as String;
|
||||
}
|
||||
|
||||
Map<String, dynamic> _$GhCreateIssueIssueToJson(GhCreateIssueIssue instance) =>
|
||||
<String, dynamic>{
|
||||
'number': instance.number,
|
||||
'repository': instance.repository?.toJson(),
|
||||
'__typename': instance.resolveType,
|
||||
};
|
||||
|
||||
GhCreateIssueRepository _$GhCreateIssueRepositoryFromJson(
|
||||
Map<String, dynamic> json) {
|
||||
return GhCreateIssueRepository()
|
||||
..owner = json['owner'] == null
|
||||
? null
|
||||
: GhCreateIssueRepositoryOwner.fromJson(
|
||||
json['owner'] as Map<String, dynamic>)
|
||||
..name = json['name'] as String
|
||||
..resolveType = json['__typename'] as String;
|
||||
}
|
||||
|
||||
Map<String, dynamic> _$GhCreateIssueRepositoryToJson(
|
||||
GhCreateIssueRepository instance) =>
|
||||
<String, dynamic>{
|
||||
'owner': instance.owner?.toJson(),
|
||||
'name': instance.name,
|
||||
'__typename': instance.resolveType,
|
||||
};
|
||||
|
||||
GhCreateIssueRepositoryOwner _$GhCreateIssueRepositoryOwnerFromJson(
|
||||
Map<String, dynamic> json) {
|
||||
return GhCreateIssueRepositoryOwner()
|
||||
..login = json['login'] as String
|
||||
..resolveType = json['__typename'] as String;
|
||||
}
|
||||
|
||||
Map<String, dynamic> _$GhCreateIssueRepositoryOwnerToJson(
|
||||
GhCreateIssueRepositoryOwner instance) =>
|
||||
<String, dynamic>{
|
||||
'login': instance.login,
|
||||
'__typename': instance.resolveType,
|
||||
};
|
||||
|
||||
GhCreateIssuePinnableItem _$GhCreateIssuePinnableItemFromJson(
|
||||
Map<String, dynamic> json) {
|
||||
return GhCreateIssuePinnableItem();
|
||||
}
|
||||
|
||||
Map<String, dynamic> _$GhCreateIssuePinnableItemToJson(
|
||||
GhCreateIssuePinnableItem instance) =>
|
||||
<String, dynamic>{};
|
||||
|
||||
GhCreateIssueNode _$GhCreateIssueNodeFromJson(Map<String, dynamic> json) {
|
||||
return GhCreateIssueNode()..resolveType = json['__typename'] as String;
|
||||
}
|
||||
|
||||
Map<String, dynamic> _$GhCreateIssueNodeToJson(GhCreateIssueNode instance) =>
|
||||
<String, dynamic>{
|
||||
'__typename': instance.resolveType,
|
||||
};
|
||||
|
||||
GhCreateIssueProjectOwner _$GhCreateIssueProjectOwnerFromJson(
|
||||
Map<String, dynamic> json) {
|
||||
return GhCreateIssueProjectOwner()
|
||||
..resolveType = json['__typename'] as String;
|
||||
}
|
||||
|
||||
Map<String, dynamic> _$GhCreateIssueProjectOwnerToJson(
|
||||
GhCreateIssueProjectOwner instance) =>
|
||||
<String, dynamic>{
|
||||
'__typename': instance.resolveType,
|
||||
};
|
||||
|
||||
GhCreateIssueRegistryPackageOwner _$GhCreateIssueRegistryPackageOwnerFromJson(
|
||||
Map<String, dynamic> json) {
|
||||
return GhCreateIssueRegistryPackageOwner()
|
||||
..resolveType = json['__typename'] as String;
|
||||
}
|
||||
|
||||
Map<String, dynamic> _$GhCreateIssueRegistryPackageOwnerToJson(
|
||||
GhCreateIssueRegistryPackageOwner instance) =>
|
||||
<String, dynamic>{
|
||||
'__typename': instance.resolveType,
|
||||
};
|
||||
|
||||
GhCreateIssueRegistryPackageSearch _$GhCreateIssueRegistryPackageSearchFromJson(
|
||||
Map<String, dynamic> json) {
|
||||
return GhCreateIssueRegistryPackageSearch()
|
||||
..resolveType = json['__typename'] as String;
|
||||
}
|
||||
|
||||
Map<String, dynamic> _$GhCreateIssueRegistryPackageSearchToJson(
|
||||
GhCreateIssueRegistryPackageSearch instance) =>
|
||||
<String, dynamic>{
|
||||
'__typename': instance.resolveType,
|
||||
};
|
||||
|
||||
GhCreateIssueSubscribable _$GhCreateIssueSubscribableFromJson(
|
||||
Map<String, dynamic> json) {
|
||||
return GhCreateIssueSubscribable()
|
||||
..resolveType = json['__typename'] as String;
|
||||
}
|
||||
|
||||
Map<String, dynamic> _$GhCreateIssueSubscribableToJson(
|
||||
GhCreateIssueSubscribable instance) =>
|
||||
<String, dynamic>{
|
||||
'__typename': instance.resolveType,
|
||||
};
|
||||
|
||||
GhCreateIssueStarrable _$GhCreateIssueStarrableFromJson(
|
||||
Map<String, dynamic> json) {
|
||||
return GhCreateIssueStarrable()..resolveType = json['__typename'] as String;
|
||||
}
|
||||
|
||||
Map<String, dynamic> _$GhCreateIssueStarrableToJson(
|
||||
GhCreateIssueStarrable instance) =>
|
||||
<String, dynamic>{
|
||||
'__typename': instance.resolveType,
|
||||
};
|
||||
|
||||
GhCreateIssueUniformResourceLocatable
|
||||
_$GhCreateIssueUniformResourceLocatableFromJson(Map<String, dynamic> json) {
|
||||
return GhCreateIssueUniformResourceLocatable()
|
||||
..resolveType = json['__typename'] as String;
|
||||
}
|
||||
|
||||
Map<String, dynamic> _$GhCreateIssueUniformResourceLocatableToJson(
|
||||
GhCreateIssueUniformResourceLocatable instance) =>
|
||||
<String, dynamic>{
|
||||
'__typename': instance.resolveType,
|
||||
};
|
||||
|
||||
GhCreateIssueRepositoryInfo _$GhCreateIssueRepositoryInfoFromJson(
|
||||
Map<String, dynamic> json) {
|
||||
return GhCreateIssueRepositoryInfo()
|
||||
..owner = json['owner'] == null
|
||||
? null
|
||||
: GhCreateIssueRepositoryOwner.fromJson(
|
||||
json['owner'] as Map<String, dynamic>)
|
||||
..name = json['name'] as String
|
||||
..resolveType = json['__typename'] as String;
|
||||
}
|
||||
|
||||
Map<String, dynamic> _$GhCreateIssueRepositoryInfoToJson(
|
||||
GhCreateIssueRepositoryInfo instance) =>
|
||||
<String, dynamic>{
|
||||
'owner': instance.owner?.toJson(),
|
||||
'name': instance.name,
|
||||
'__typename': instance.resolveType,
|
||||
};
|
||||
|
||||
GhCreateIssueProjectCardItem _$GhCreateIssueProjectCardItemFromJson(
|
||||
Map<String, dynamic> json) {
|
||||
return GhCreateIssueProjectCardItem();
|
||||
}
|
||||
|
||||
Map<String, dynamic> _$GhCreateIssueProjectCardItemToJson(
|
||||
GhCreateIssueProjectCardItem instance) =>
|
||||
<String, dynamic>{};
|
||||
|
||||
GhCreateIssueAssignable _$GhCreateIssueAssignableFromJson(
|
||||
Map<String, dynamic> json) {
|
||||
return GhCreateIssueAssignable()..resolveType = json['__typename'] as String;
|
||||
}
|
||||
|
||||
Map<String, dynamic> _$GhCreateIssueAssignableToJson(
|
||||
GhCreateIssueAssignable instance) =>
|
||||
<String, dynamic>{
|
||||
'__typename': instance.resolveType,
|
||||
};
|
||||
|
||||
GhCreateIssueClosable _$GhCreateIssueClosableFromJson(
|
||||
Map<String, dynamic> json) {
|
||||
return GhCreateIssueClosable()..resolveType = json['__typename'] as String;
|
||||
}
|
||||
|
||||
Map<String, dynamic> _$GhCreateIssueClosableToJson(
|
||||
GhCreateIssueClosable instance) =>
|
||||
<String, dynamic>{
|
||||
'__typename': instance.resolveType,
|
||||
};
|
||||
|
||||
GhCreateIssueComment _$GhCreateIssueCommentFromJson(Map<String, dynamic> json) {
|
||||
return GhCreateIssueComment()..resolveType = json['__typename'] as String;
|
||||
}
|
||||
|
||||
Map<String, dynamic> _$GhCreateIssueCommentToJson(
|
||||
GhCreateIssueComment instance) =>
|
||||
<String, dynamic>{
|
||||
'__typename': instance.resolveType,
|
||||
};
|
||||
|
||||
GhCreateIssueUpdatable _$GhCreateIssueUpdatableFromJson(
|
||||
Map<String, dynamic> json) {
|
||||
return GhCreateIssueUpdatable()..resolveType = json['__typename'] as String;
|
||||
}
|
||||
|
||||
Map<String, dynamic> _$GhCreateIssueUpdatableToJson(
|
||||
GhCreateIssueUpdatable instance) =>
|
||||
<String, dynamic>{
|
||||
'__typename': instance.resolveType,
|
||||
};
|
||||
|
||||
GhCreateIssueUpdatableComment _$GhCreateIssueUpdatableCommentFromJson(
|
||||
Map<String, dynamic> json) {
|
||||
return GhCreateIssueUpdatableComment()
|
||||
..resolveType = json['__typename'] as String;
|
||||
}
|
||||
|
||||
Map<String, dynamic> _$GhCreateIssueUpdatableCommentToJson(
|
||||
GhCreateIssueUpdatableComment instance) =>
|
||||
<String, dynamic>{
|
||||
'__typename': instance.resolveType,
|
||||
};
|
||||
|
||||
GhCreateIssueLabelable _$GhCreateIssueLabelableFromJson(
|
||||
Map<String, dynamic> json) {
|
||||
return GhCreateIssueLabelable()..resolveType = json['__typename'] as String;
|
||||
}
|
||||
|
||||
Map<String, dynamic> _$GhCreateIssueLabelableToJson(
|
||||
GhCreateIssueLabelable instance) =>
|
||||
<String, dynamic>{
|
||||
'__typename': instance.resolveType,
|
||||
};
|
||||
|
||||
GhCreateIssueLockable _$GhCreateIssueLockableFromJson(
|
||||
Map<String, dynamic> json) {
|
||||
return GhCreateIssueLockable()..resolveType = json['__typename'] as String;
|
||||
}
|
||||
|
||||
Map<String, dynamic> _$GhCreateIssueLockableToJson(
|
||||
GhCreateIssueLockable instance) =>
|
||||
<String, dynamic>{
|
||||
'__typename': instance.resolveType,
|
||||
};
|
||||
|
||||
GhCreateIssueReactable _$GhCreateIssueReactableFromJson(
|
||||
Map<String, dynamic> json) {
|
||||
return GhCreateIssueReactable()..resolveType = json['__typename'] as String;
|
||||
}
|
||||
|
||||
Map<String, dynamic> _$GhCreateIssueReactableToJson(
|
||||
GhCreateIssueReactable instance) =>
|
||||
<String, dynamic>{
|
||||
'__typename': instance.resolveType,
|
||||
};
|
||||
|
||||
GhCreateIssueRepositoryNode _$GhCreateIssueRepositoryNodeFromJson(
|
||||
Map<String, dynamic> json) {
|
||||
return GhCreateIssueRepositoryNode()
|
||||
..repository = json['repository'] == null
|
||||
? null
|
||||
: GhCreateIssueRepository.fromJson(
|
||||
json['repository'] as Map<String, dynamic>)
|
||||
..resolveType = json['__typename'] as String;
|
||||
}
|
||||
|
||||
Map<String, dynamic> _$GhCreateIssueRepositoryNodeToJson(
|
||||
GhCreateIssueRepositoryNode instance) =>
|
||||
<String, dynamic>{
|
||||
'repository': instance.repository?.toJson(),
|
||||
'__typename': instance.resolveType,
|
||||
};
|
||||
|
||||
GhCreateIssueArguments _$GhCreateIssueArgumentsFromJson(
|
||||
Map<String, dynamic> json) {
|
||||
return GhCreateIssueArguments(
|
||||
repoId: json['repoId'] as String,
|
||||
title: json['title'] as String,
|
||||
body: json['body'] as String,
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> _$GhCreateIssueArgumentsToJson(
|
||||
GhCreateIssueArguments instance) =>
|
||||
<String, dynamic>{
|
||||
'repoId': instance.repoId,
|
||||
'title': instance.title,
|
||||
'body': instance.body,
|
||||
};
|
||||
|
||||
GhRepoId _$GhRepoIdFromJson(Map<String, dynamic> json) {
|
||||
return GhRepoId()
|
||||
..repository = json['repository'] == null
|
||||
? null
|
||||
: GhRepoIdRepository.fromJson(
|
||||
json['repository'] as Map<String, dynamic>);
|
||||
}
|
||||
|
||||
Map<String, dynamic> _$GhRepoIdToJson(GhRepoId instance) => <String, dynamic>{
|
||||
'repository': instance.repository?.toJson(),
|
||||
};
|
||||
|
||||
GhRepoIdRepository _$GhRepoIdRepositoryFromJson(Map<String, dynamic> json) {
|
||||
return GhRepoIdRepository()
|
||||
..id = json['id'] as String
|
||||
..resolveType = json['__typename'] as String;
|
||||
}
|
||||
|
||||
Map<String, dynamic> _$GhRepoIdRepositoryToJson(GhRepoIdRepository instance) =>
|
||||
<String, dynamic>{
|
||||
'id': instance.id,
|
||||
'__typename': instance.resolveType,
|
||||
};
|
||||
|
||||
GhRepoIdPinnableItem _$GhRepoIdPinnableItemFromJson(Map<String, dynamic> json) {
|
||||
return GhRepoIdPinnableItem();
|
||||
}
|
||||
|
||||
Map<String, dynamic> _$GhRepoIdPinnableItemToJson(
|
||||
GhRepoIdPinnableItem instance) =>
|
||||
<String, dynamic>{};
|
||||
|
||||
GhRepoIdNode _$GhRepoIdNodeFromJson(Map<String, dynamic> json) {
|
||||
return GhRepoIdNode()
|
||||
..id = json['id'] as String
|
||||
..resolveType = json['__typename'] as String;
|
||||
}
|
||||
|
||||
Map<String, dynamic> _$GhRepoIdNodeToJson(GhRepoIdNode instance) =>
|
||||
<String, dynamic>{
|
||||
'id': instance.id,
|
||||
'__typename': instance.resolveType,
|
||||
};
|
||||
|
||||
GhRepoIdProjectOwner _$GhRepoIdProjectOwnerFromJson(Map<String, dynamic> json) {
|
||||
return GhRepoIdProjectOwner()
|
||||
..id = json['id'] as String
|
||||
..resolveType = json['__typename'] as String;
|
||||
}
|
||||
|
||||
Map<String, dynamic> _$GhRepoIdProjectOwnerToJson(
|
||||
GhRepoIdProjectOwner instance) =>
|
||||
<String, dynamic>{
|
||||
'id': instance.id,
|
||||
'__typename': instance.resolveType,
|
||||
};
|
||||
|
||||
GhRepoIdRegistryPackageOwner _$GhRepoIdRegistryPackageOwnerFromJson(
|
||||
Map<String, dynamic> json) {
|
||||
return GhRepoIdRegistryPackageOwner()
|
||||
..id = json['id'] as String
|
||||
..resolveType = json['__typename'] as String;
|
||||
}
|
||||
|
||||
Map<String, dynamic> _$GhRepoIdRegistryPackageOwnerToJson(
|
||||
GhRepoIdRegistryPackageOwner instance) =>
|
||||
<String, dynamic>{
|
||||
'id': instance.id,
|
||||
'__typename': instance.resolveType,
|
||||
};
|
||||
|
||||
GhRepoIdRegistryPackageSearch _$GhRepoIdRegistryPackageSearchFromJson(
|
||||
Map<String, dynamic> json) {
|
||||
return GhRepoIdRegistryPackageSearch()
|
||||
..id = json['id'] as String
|
||||
..resolveType = json['__typename'] as String;
|
||||
}
|
||||
|
||||
Map<String, dynamic> _$GhRepoIdRegistryPackageSearchToJson(
|
||||
GhRepoIdRegistryPackageSearch instance) =>
|
||||
<String, dynamic>{
|
||||
'id': instance.id,
|
||||
'__typename': instance.resolveType,
|
||||
};
|
||||
|
||||
GhRepoIdSubscribable _$GhRepoIdSubscribableFromJson(Map<String, dynamic> json) {
|
||||
return GhRepoIdSubscribable()
|
||||
..id = json['id'] as String
|
||||
..resolveType = json['__typename'] as String;
|
||||
}
|
||||
|
||||
Map<String, dynamic> _$GhRepoIdSubscribableToJson(
|
||||
GhRepoIdSubscribable instance) =>
|
||||
<String, dynamic>{
|
||||
'id': instance.id,
|
||||
'__typename': instance.resolveType,
|
||||
};
|
||||
|
||||
GhRepoIdStarrable _$GhRepoIdStarrableFromJson(Map<String, dynamic> json) {
|
||||
return GhRepoIdStarrable()
|
||||
..id = json['id'] as String
|
||||
..resolveType = json['__typename'] as String;
|
||||
}
|
||||
|
||||
Map<String, dynamic> _$GhRepoIdStarrableToJson(GhRepoIdStarrable instance) =>
|
||||
<String, dynamic>{
|
||||
'id': instance.id,
|
||||
'__typename': instance.resolveType,
|
||||
};
|
||||
|
||||
GhRepoIdUniformResourceLocatable _$GhRepoIdUniformResourceLocatableFromJson(
|
||||
Map<String, dynamic> json) {
|
||||
return GhRepoIdUniformResourceLocatable()
|
||||
..resolveType = json['__typename'] as String;
|
||||
}
|
||||
|
||||
Map<String, dynamic> _$GhRepoIdUniformResourceLocatableToJson(
|
||||
GhRepoIdUniformResourceLocatable instance) =>
|
||||
<String, dynamic>{
|
||||
'__typename': instance.resolveType,
|
||||
};
|
||||
|
||||
GhRepoIdRepositoryInfo _$GhRepoIdRepositoryInfoFromJson(
|
||||
Map<String, dynamic> json) {
|
||||
return GhRepoIdRepositoryInfo()..resolveType = json['__typename'] as String;
|
||||
}
|
||||
|
||||
Map<String, dynamic> _$GhRepoIdRepositoryInfoToJson(
|
||||
GhRepoIdRepositoryInfo instance) =>
|
||||
<String, dynamic>{
|
||||
'__typename': instance.resolveType,
|
||||
};
|
||||
|
||||
GhRepoIdArguments _$GhRepoIdArgumentsFromJson(Map<String, dynamic> json) {
|
||||
return GhRepoIdArguments(
|
||||
owner: json['owner'] as String,
|
||||
name: json['name'] as String,
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> _$GhRepoIdArgumentsToJson(GhRepoIdArguments instance) =>
|
||||
<String, dynamic>{
|
||||
'owner': instance.owner,
|
||||
'name': instance.name,
|
||||
};
|
||||
|
13
lib/graphql/gh_create_issue.graphql
Normal file
13
lib/graphql/gh_create_issue.graphql
Normal file
@ -0,0 +1,13 @@
|
||||
mutation GhCreateIssue($repoId: ID!, $title: String!, $body: String!) {
|
||||
createIssue(input: { repositoryId: $repoId, title: $title, body: $body }) {
|
||||
issue {
|
||||
number
|
||||
repository {
|
||||
owner {
|
||||
login
|
||||
}
|
||||
name
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
5
lib/graphql/gh_repo_id.graphql
Normal file
5
lib/graphql/gh_repo_id.graphql
Normal file
@ -0,0 +1,5 @@
|
||||
query GhRepoId($owner: String!, $name: String!) {
|
||||
repository(owner: $owner, name: $name) {
|
||||
id
|
||||
}
|
||||
}
|
@ -272,26 +272,6 @@ class AuthModel with ChangeNotifier {
|
||||
.timeout(_timeoutDuration);
|
||||
}
|
||||
|
||||
Future<http.Response> postWithCredentials(
|
||||
String url, {
|
||||
String contentType = 'application/json',
|
||||
Map<String, dynamic> body = const {},
|
||||
}) async {
|
||||
return http
|
||||
.post(
|
||||
_apiPrefix + url,
|
||||
headers: {..._headers, HttpHeaders.contentTypeHeader: contentType},
|
||||
body: json.encode(body),
|
||||
)
|
||||
.timeout(_timeoutDuration);
|
||||
}
|
||||
|
||||
Future<void> deleteWithCredentials(String url) async {
|
||||
await http
|
||||
.delete(_apiPrefix + url, headers: _headers)
|
||||
.timeout(_timeoutDuration);
|
||||
}
|
||||
|
||||
String _oauthState;
|
||||
void redirectToGithubOauth() {
|
||||
_oauthState = nanoid();
|
||||
|
@ -1,8 +1,6 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:fimber/fimber.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:git_touch/graphql/gh.dart';
|
||||
import 'package:git_touch/models/auth.dart';
|
||||
import 'package:git_touch/models/theme.dart';
|
||||
import 'package:git_touch/scaffolds/common.dart';
|
||||
@ -27,11 +25,8 @@ class IssueFormScreen extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _IssueFormScreenState extends State<IssueFormScreen> {
|
||||
String get owner => widget.owner;
|
||||
String get name => widget.name;
|
||||
|
||||
String _title = '';
|
||||
String _body = '';
|
||||
var _title = '';
|
||||
var _body = '';
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@ -65,21 +60,24 @@ class _IssueFormScreenState extends State<IssueFormScreen> {
|
||||
CupertinoButton.filled(
|
||||
child: Text('Submit'),
|
||||
onPressed: () async {
|
||||
try {
|
||||
var res =
|
||||
await Provider.of<AuthModel>(context).postWithCredentials(
|
||||
'/repos/$owner/$name/issues',
|
||||
body: {'title': _title, 'body': _body},
|
||||
);
|
||||
if (res.statusCode != HttpStatus.created) {
|
||||
throw 'Create fail, response: ${res.body}';
|
||||
}
|
||||
await Provider.of<ThemeModel>(context)
|
||||
.showConfirm(context, Text('Issue created'));
|
||||
Navigator.of(context).pop();
|
||||
} catch (err) {
|
||||
Fimber.e('postWithCredentials failed', ex: err); // TODO:
|
||||
}
|
||||
final auth = Provider.of<AuthModel>(context);
|
||||
final theme = Provider.of<ThemeModel>(context);
|
||||
final r0 = await auth.gqlClient.execute(
|
||||
GhRepoIdQuery(
|
||||
variables:
|
||||
GhRepoIdArguments(owner: widget.owner, name: widget.name),
|
||||
),
|
||||
);
|
||||
final res = await auth.gqlClient.execute(GhCreateIssueQuery(
|
||||
variables: GhCreateIssueArguments(
|
||||
repoId: r0.data.repository.id, title: _title, body: _body),
|
||||
));
|
||||
final issue = res.data.createIssue.issue;
|
||||
await theme.push(
|
||||
context,
|
||||
'/${issue.repository.owner.login}/${issue.repository.name}/issues/${issue.number}',
|
||||
replace: true,
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
|
Loading…
x
Reference in New Issue
Block a user