diff options
author | Amine Hilaly <hilalyamine@gmail.com> | 2019-06-23 13:50:45 +0200 |
---|---|---|
committer | Amine Hilaly <hilalyamine@gmail.com> | 2019-06-24 21:33:29 +0200 |
commit | 0dea0f6a7673865b16e71f1998c3b0db33a54514 (patch) | |
tree | 02124e2f3cc0871a849bdb2af68a8d012ba01572 /bridge/github/export_mutation.go | |
parent | fc09f2a492348f3b6013308697cbc86e15e8ab47 (diff) | |
download | git-bug-0dea0f6a7673865b16e71f1998c3b0db33a54514.tar.gz |
[bridge/github] simplify export operation hashs
[bridge/github] exporter tests: add more test cases and global tests
[bridge/github] rename export_query to export_mutation
[bridge/github] exporter: Log number of exported issues and labels
[bridge/github] Improve comments
Diffstat (limited to 'bridge/github/export_mutation.go')
-rw-r--r-- | bridge/github/export_mutation.go | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/bridge/github/export_mutation.go b/bridge/github/export_mutation.go new file mode 100644 index 00000000..95d4e6a9 --- /dev/null +++ b/bridge/github/export_mutation.go @@ -0,0 +1,74 @@ +package github + +import "github.com/shurcooL/githubv4" + +type createIssueMutation struct { + CreateIssue struct { + Issue struct { + ID string `graphql:"id"` + URL string `graphql:"url"` + } + } `graphql:"createIssue(input:$input)"` +} + +type updateIssueMutation struct { + UpdateIssue struct { + Issue struct { + ID string `graphql:"id"` + URL string `graphql:"url"` + } + } `graphql:"updateIssue(input:$input)"` +} + +type addCommentToIssueMutation struct { + AddComment struct { + CommentEdge struct { + Node struct { + ID string `graphql:"id"` + URL string `graphql:"url"` + } + } + } `graphql:"addComment(input:$input)"` +} + +type updateIssueCommentMutation struct { + UpdateIssueComment struct { + IssueComment struct { + ID string `graphql:"id"` + URL string `graphql:"url"` + } `graphql:"issueComment"` + } `graphql:"updateIssueComment(input:$input)"` +} + +type removeLabelsFromLabelableMutation struct { + AddLabels struct { + Labelable struct { + Typename string `graphql:"__typename"` + } + } `graphql:"removeLabelsFromLabelable(input:$input)"` +} + +type addLabelsToLabelableMutation struct { + RemoveLabels struct { + Labelable struct { + Typename string `graphql:"__typename"` + } + } `graphql:"addLabelsToLabelable(input:$input)"` +} + +type createLabelMutation struct { + CreateLabel struct { + Label struct { + ID string `graphql:"id"` + } `graphql:"label"` + } `graphql:"createLabel(input: $input)"` +} + +type createLabelInput struct { + Color githubv4.String `json:"color"` + Description *githubv4.String `json:"description,omitempty"` + Name githubv4.String `json:"name"` + RepositoryID githubv4.ID `json:"repositoryId"` + + ClientMutationID *githubv4.String `json:"clientMutationId,omitempty"` +} |