Skip to content

Commit

Permalink
regenerate
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam Scarr committed Apr 20, 2018
1 parent e330ebb commit 6fb9e98
Show file tree
Hide file tree
Showing 8 changed files with 127 additions and 50 deletions.
2 changes: 1 addition & 1 deletion codegen/templates/data.go

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

55 changes: 38 additions & 17 deletions example/chat/generated.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,25 +35,39 @@ func (e *executableSchema) Schema() *schema.Schema {
func (e *executableSchema) Query(ctx context.Context, op *query.Operation) *graphql.Response {
ec := executionContext{graphql.GetRequestContext(ctx), e.resolvers}

data := ec._Query(ctx, op.Selections)
var buf bytes.Buffer
data.MarshalGQL(&buf)
bufRaw, err := ec.Middleware(ctx, func(ctx context.Context) (res interface{}, err error) {
data := ec._Query(ctx, op.Selections)
var buf bytes.Buffer
data.MarshalGQL(&buf)
return buf.Bytes(), nil
})
buf := bufRaw.([]byte)
if err != nil {
ec.Error(err)
}

return &graphql.Response{
Data: buf.Bytes(),
Data: buf,
Errors: ec.Errors,
}
}

func (e *executableSchema) Mutation(ctx context.Context, op *query.Operation) *graphql.Response {
ec := executionContext{graphql.GetRequestContext(ctx), e.resolvers}

data := ec._Mutation(ctx, op.Selections)
var buf bytes.Buffer
data.MarshalGQL(&buf)
bufRaw, err := ec.Middleware(ctx, func(ctx context.Context) (res interface{}, err error) {
data := ec._Mutation(ctx, op.Selections)
var buf bytes.Buffer
data.MarshalGQL(&buf)
return buf.Bytes(), nil
})
buf := bufRaw.([]byte)
if err != nil {
ec.Error(err)
}

return &graphql.Response{
Data: buf.Bytes(),
Data: buf,
Errors: ec.Errors,
}
}
Expand All @@ -68,18 +82,25 @@ func (e *executableSchema) Subscription(ctx context.Context, op *query.Operation

var buf bytes.Buffer
return func() *graphql.Response {
buf.Reset()
data := next()
if data == nil {
return nil
bufRaw, err := ec.Middleware(ctx, func(ctx context.Context) (res interface{}, err error) {
buf.Reset()
data := next()

if data == nil {
return []byte(nil), nil
}
data.MarshalGQL(&buf)
return buf.Bytes(), nil
})

buf := bufRaw.([]byte)
if err != nil {
ec.Error(err)
}
data.MarshalGQL(&buf)

errs := ec.Errors
ec.Errors = nil
return &graphql.Response{
Data: buf.Bytes(),
Errors: errs,
Data: buf,
Errors: ec.Errors,
}
}
}
Expand Down
15 changes: 11 additions & 4 deletions example/dataloader/generated.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,19 @@ func (e *executableSchema) Schema() *schema.Schema {
func (e *executableSchema) Query(ctx context.Context, op *query.Operation) *graphql.Response {
ec := executionContext{graphql.GetRequestContext(ctx), e.resolvers}

data := ec._Query(ctx, op.Selections)
var buf bytes.Buffer
data.MarshalGQL(&buf)
bufRaw, err := ec.Middleware(ctx, func(ctx context.Context) (res interface{}, err error) {
data := ec._Query(ctx, op.Selections)
var buf bytes.Buffer
data.MarshalGQL(&buf)
return buf.Bytes(), nil
})
buf := bufRaw.([]byte)
if err != nil {
ec.Error(err)
}

return &graphql.Response{
Data: buf.Bytes(),
Data: buf,
Errors: ec.Errors,
}
}
Expand Down
15 changes: 11 additions & 4 deletions example/scalars/generated.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,19 @@ func (e *executableSchema) Schema() *schema.Schema {
func (e *executableSchema) Query(ctx context.Context, op *query.Operation) *graphql.Response {
ec := executionContext{graphql.GetRequestContext(ctx), e.resolvers}

data := ec._Query(ctx, op.Selections)
var buf bytes.Buffer
data.MarshalGQL(&buf)
bufRaw, err := ec.Middleware(ctx, func(ctx context.Context) (res interface{}, err error) {
data := ec._Query(ctx, op.Selections)
var buf bytes.Buffer
data.MarshalGQL(&buf)
return buf.Bytes(), nil
})
buf := bufRaw.([]byte)
if err != nil {
ec.Error(err)
}

return &graphql.Response{
Data: buf.Bytes(),
Data: buf,
Errors: ec.Errors,
}
}
Expand Down
15 changes: 11 additions & 4 deletions example/selection/generated.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,19 @@ func (e *executableSchema) Schema() *schema.Schema {
func (e *executableSchema) Query(ctx context.Context, op *query.Operation) *graphql.Response {
ec := executionContext{graphql.GetRequestContext(ctx), e.resolvers}

data := ec._Query(ctx, op.Selections)
var buf bytes.Buffer
data.MarshalGQL(&buf)
bufRaw, err := ec.Middleware(ctx, func(ctx context.Context) (res interface{}, err error) {
data := ec._Query(ctx, op.Selections)
var buf bytes.Buffer
data.MarshalGQL(&buf)
return buf.Bytes(), nil
})
buf := bufRaw.([]byte)
if err != nil {
ec.Error(err)
}

return &graphql.Response{
Data: buf.Bytes(),
Data: buf,
Errors: ec.Errors,
}
}
Expand Down
30 changes: 22 additions & 8 deletions example/starwars/generated.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,25 +53,39 @@ func (e *executableSchema) Schema() *schema.Schema {
func (e *executableSchema) Query(ctx context.Context, op *query.Operation) *graphql.Response {
ec := executionContext{graphql.GetRequestContext(ctx), e.resolvers}

data := ec._Query(ctx, op.Selections)
var buf bytes.Buffer
data.MarshalGQL(&buf)
bufRaw, err := ec.Middleware(ctx, func(ctx context.Context) (res interface{}, err error) {
data := ec._Query(ctx, op.Selections)
var buf bytes.Buffer
data.MarshalGQL(&buf)
return buf.Bytes(), nil
})
buf := bufRaw.([]byte)
if err != nil {
ec.Error(err)
}

return &graphql.Response{
Data: buf.Bytes(),
Data: buf,
Errors: ec.Errors,
}
}

func (e *executableSchema) Mutation(ctx context.Context, op *query.Operation) *graphql.Response {
ec := executionContext{graphql.GetRequestContext(ctx), e.resolvers}

data := ec._Mutation(ctx, op.Selections)
var buf bytes.Buffer
data.MarshalGQL(&buf)
bufRaw, err := ec.Middleware(ctx, func(ctx context.Context) (res interface{}, err error) {
data := ec._Mutation(ctx, op.Selections)
var buf bytes.Buffer
data.MarshalGQL(&buf)
return buf.Bytes(), nil
})
buf := bufRaw.([]byte)
if err != nil {
ec.Error(err)
}

return &graphql.Response{
Data: buf.Bytes(),
Data: buf,
Errors: ec.Errors,
}
}
Expand Down
Loading

0 comments on commit 6fb9e98

Please sign in to comment.