Skip to content

Commit

Permalink
Merge pull request #929 from nmaquet/check-nil-interface-ptrs
Browse files Browse the repository at this point in the history
Don't crash when interface resolver returns a typed nil
  • Loading branch information
vektah authored Nov 28, 2019
2 parents 6f20101 + fcfe595 commit 9e989d9
Show file tree
Hide file tree
Showing 10 changed files with 580 additions and 0 deletions.
3 changes: 3 additions & 0 deletions codegen/interface.gotpl
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ func (ec *executionContext) _{{$interface.Name}}(ctx context.Context, sel ast.Se
return ec._{{$implementor.Name}}(ctx, sel, &obj)
{{- end}}
case *{{$implementor.Type | ref}}:
if obj == nil {
return graphql.Null
}
return ec._{{$implementor.Name}}(ctx, sel, obj)
{{- end }}
default:
Expand Down
Loading

0 comments on commit 9e989d9

Please sign in to comment.