aboutsummaryrefslogtreecommitdiffstats
path: root/graphql/graph
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2018-07-30 00:20:04 +0200
committerMichael Muré <batolettre@gmail.com>2018-07-30 00:20:04 +0200
commit79b3d189186783c01acb194de825976a007dbd5f (patch)
tree8369931fc77e22dff7b93de3c64d46e743592e4a /graphql/graph
parent5b70e3452a4685112fd005fef0727930ebd2adaf (diff)
downloadgit-bug-79b3d189186783c01acb194de825976a007dbd5f.tar.gz
graphql: use an interface instead of an union for the operations for easier query
Diffstat (limited to 'graphql/graph')
-rw-r--r--graphql/graph/gen_graph.go40
1 files changed, 2 insertions, 38 deletions
diff --git a/graphql/graph/gen_graph.go b/graphql/graph/gen_graph.go
index 386e9d01..b747e9d4 100644
--- a/graphql/graph/gen_graph.go
+++ b/graphql/graph/gen_graph.go
@@ -1060,7 +1060,7 @@ func (ec *executionContext) _OperationEdge_node(ctx context.Context, field graph
rctx.PushField(field.Alias)
defer rctx.Pop()
res := obj.Node
- return ec._OperationUnion(ctx, field.Selections, &res)
+ return ec._Operation(ctx, field.Selections, &res)
}
var pageInfoImplementors = []string{"PageInfo"}
@@ -2345,35 +2345,6 @@ func (ec *executionContext) _Operation(ctx context.Context, sel []query.Selectio
}
}
-func (ec *executionContext) _OperationUnion(ctx context.Context, sel []query.Selection, obj *models.OperationUnion) graphql.Marshaler {
- switch obj := (*obj).(type) {
- case nil:
- return graphql.Null
- case operations.CreateOperation:
- return ec._CreateOperation(ctx, sel, &obj)
- case *operations.CreateOperation:
- return ec._CreateOperation(ctx, sel, obj)
- case operations.SetTitleOperation:
- return ec._SetTitleOperation(ctx, sel, &obj)
- case *operations.SetTitleOperation:
- return ec._SetTitleOperation(ctx, sel, obj)
- case operations.AddCommentOperation:
- return ec._AddCommentOperation(ctx, sel, &obj)
- case *operations.AddCommentOperation:
- return ec._AddCommentOperation(ctx, sel, obj)
- case operations.SetStatusOperation:
- return ec._SetStatusOperation(ctx, sel, &obj)
- case *operations.SetStatusOperation:
- return ec._SetStatusOperation(ctx, sel, obj)
- case operations.LabelChangeOperation:
- return ec._LabelChangeOperation(ctx, sel, &obj)
- case *operations.LabelChangeOperation:
- return ec._LabelChangeOperation(ctx, sel, obj)
- default:
- panic(fmt.Errorf("unexpected type %T", obj))
- }
-}
-
func UnmarshalConnectionInput(v interface{}) (models.ConnectionInput, error) {
var it models.ConnectionInput
var asMap = v.(map[string]interface{})
@@ -2523,7 +2494,7 @@ type OperationConnection {
type OperationEdge {
cursor: String!
- node: OperationUnion!
+ node: Operation!
}
# An operation applied to a bug.
@@ -2572,13 +2543,6 @@ type LabelChangeOperation implements Operation, Authored {
removed: [Label!]!
}
-union OperationUnion =
- CreateOperation
- | SetTitleOperation
- | AddCommentOperation
- | SetStatusOperation
- | LabelChangeOperation
-
# The connection type for Bug.
type BugConnection {
# A list of edges.