Skip to content

Commit

Permalink
add IsResolver to FieldContext
Browse files Browse the repository at this point in the history
  • Loading branch information
skaji committed Aug 31, 2020
1 parent 622316e commit 5595116
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions codegen/field.gotpl
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ func (ec *executionContext) _{{$object.Name}}_{{$field.Name}}(ctx context.Contex
Field: field,
Args: nil,
IsMethod: {{or $field.IsMethod $field.IsResolver}},
IsResolver: {{ $field.IsResolver }},
}

ctx = graphql.WithFieldContext(ctx, fc)
Expand Down
2 changes: 2 additions & 0 deletions graphql/context_field.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ type FieldContext struct {
Result interface{}
// IsMethod indicates if the resolver is a method
IsMethod bool
// IsResolver indicates if the field has a user-specified resolver
IsResolver bool
}

type FieldStats struct {
Expand Down

0 comments on commit 5595116

Please sign in to comment.