Skip to content

Commit

Permalink
regenerate code
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam Scarr committed Apr 5, 2018
1 parent 5b90850 commit 2e32c12
Show file tree
Hide file tree
Showing 9 changed files with 623 additions and 104 deletions.
92 changes: 91 additions & 1 deletion Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions codegen/templates/data.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

50 changes: 42 additions & 8 deletions example/chat/generated.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ func (ec *executionContext) _Mutation(ctx context.Context, sel []query.Selection
}

func (ec *executionContext) _Mutation_post(ctx context.Context, field graphql.CollectedField) graphql.Marshaler {
args := map[string]interface{}{}
var arg0 string
if tmp, ok := field.Args["text"]; ok {
var err error
Expand All @@ -208,6 +209,7 @@ func (ec *executionContext) _Mutation_post(ctx context.Context, field graphql.Co
return graphql.Null
}
}
args["text"] = arg0
var arg1 string
if tmp, ok := field.Args["username"]; ok {
var err error
Expand All @@ -217,6 +219,7 @@ func (ec *executionContext) _Mutation_post(ctx context.Context, field graphql.Co
return graphql.Null
}
}
args["username"] = arg1
var arg2 string
if tmp, ok := field.Args["roomName"]; ok {
var err error
Expand All @@ -226,12 +229,23 @@ func (ec *executionContext) _Mutation_post(ctx context.Context, field graphql.Co
return graphql.Null
}
}
rctx := graphql.WithResolverContext(ctx, &graphql.ResolverContext{Field: field})
res, err := ec.resolvers.Mutation_post(rctx, arg0, arg1, arg2)
args["roomName"] = arg2
rctx := graphql.WithResolverContext(ctx, &graphql.ResolverContext{
Object: "Mutation",
Args: args,
Field: field,
})
resTmp, err := ec.Middleware(rctx, func(rctx context.Context) (interface{}, error) {
return ec.resolvers.Mutation_post(rctx, args["text"].(string), args["username"].(string), args["roomName"].(string))
})
if err != nil {
ec.Error(err)
return graphql.Null
}
if resTmp == nil {
return graphql.Null
}
res := resTmp.(Message)
return ec._Message(ctx, field.Selections, &res)
}

Expand Down Expand Up @@ -262,6 +276,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel []query.Selection) g
}

func (ec *executionContext) _Query_room(ctx context.Context, field graphql.CollectedField) graphql.Marshaler {
args := map[string]interface{}{}
var arg0 string
if tmp, ok := field.Args["name"]; ok {
var err error
Expand All @@ -271,6 +286,7 @@ func (ec *executionContext) _Query_room(ctx context.Context, field graphql.Colle
return graphql.Null
}
}
args["name"] = arg0
return graphql.Defer(func() (ret graphql.Marshaler) {
defer func() {
if r := recover(); r != nil {
Expand All @@ -279,12 +295,22 @@ func (ec *executionContext) _Query_room(ctx context.Context, field graphql.Colle
ret = graphql.Null
}
}()
rctx := graphql.WithResolverContext(ctx, &graphql.ResolverContext{Field: field})
res, err := ec.resolvers.Query_room(rctx, arg0)
rctx := graphql.WithResolverContext(ctx, &graphql.ResolverContext{
Object: "Query",
Args: args,
Field: field,
})
resTmp, err := ec.Middleware(rctx, func(rctx context.Context) (interface{}, error) {
return ec.resolvers.Query_room(rctx, args["name"].(string))
})
if err != nil {
ec.Error(err)
return graphql.Null
}
if resTmp == nil {
return graphql.Null
}
res := resTmp.(*Chatroom)
if res == nil {
return graphql.Null
}
Expand All @@ -301,6 +327,7 @@ func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.C
}

func (ec *executionContext) _Query___type(ctx context.Context, field graphql.CollectedField) graphql.Marshaler {
args := map[string]interface{}{}
var arg0 string
if tmp, ok := field.Args["name"]; ok {
var err error
Expand All @@ -310,7 +337,8 @@ func (ec *executionContext) _Query___type(ctx context.Context, field graphql.Col
return graphql.Null
}
}
res := ec.introspectType(arg0)
args["name"] = arg0
res := ec.introspectType(args["name"].(string))
if res == nil {
return graphql.Null
}
Expand All @@ -337,6 +365,7 @@ func (ec *executionContext) _Subscription(ctx context.Context, sel []query.Selec
}

func (ec *executionContext) _Subscription_messageAdded(ctx context.Context, field graphql.CollectedField) func() graphql.Marshaler {
args := map[string]interface{}{}
var arg0 string
if tmp, ok := field.Args["roomName"]; ok {
var err error
Expand All @@ -346,8 +375,9 @@ func (ec *executionContext) _Subscription_messageAdded(ctx context.Context, fiel
return nil
}
}
args["roomName"] = arg0
rctx := graphql.WithResolverContext(ctx, &graphql.ResolverContext{Field: field})
results, err := ec.resolvers.Subscription_messageAdded(rctx, arg0)
results, err := ec.resolvers.Subscription_messageAdded(rctx, args["roomName"].(string))
if err != nil {
ec.Error(err)
return nil
Expand Down Expand Up @@ -760,6 +790,7 @@ func (ec *executionContext) ___Type_description(ctx context.Context, field graph
}

func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler {
args := map[string]interface{}{}
var arg0 bool
if tmp, ok := field.Args["includeDeprecated"]; ok {
var err error
Expand All @@ -769,7 +800,8 @@ func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.Co
return graphql.Null
}
}
res := obj.Fields(arg0)
args["includeDeprecated"] = arg0
res := obj.Fields(args["includeDeprecated"].(bool))
arr1 := graphql.Array{}
for idx1 := range res {
arr1 = append(arr1, func() graphql.Marshaler {
Expand Down Expand Up @@ -811,6 +843,7 @@ func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field gra
}

func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler {
args := map[string]interface{}{}
var arg0 bool
if tmp, ok := field.Args["includeDeprecated"]; ok {
var err error
Expand All @@ -820,7 +853,8 @@ func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphq
return graphql.Null
}
}
res := obj.EnumValues(arg0)
args["includeDeprecated"] = arg0
res := obj.EnumValues(args["includeDeprecated"].(bool))
arr1 := graphql.Array{}
for idx1 := range res {
arr1 = append(arr1, func() graphql.Marshaler {
Expand Down
Loading

0 comments on commit 2e32c12

Please sign in to comment.