Skip to content

Commit

Permalink
Fix marhaling interfaces and unions
Browse files Browse the repository at this point in the history
  • Loading branch information
Вячеслав Крупянский committed Sep 19, 2024
1 parent 9a1d923 commit f1eafcb
Show file tree
Hide file tree
Showing 15 changed files with 174 additions and 181 deletions.
8 changes: 4 additions & 4 deletions _examples/federation/accounts/graph/generated.go

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

8 changes: 4 additions & 4 deletions _examples/federation/products/graph/generated.go

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

16 changes: 8 additions & 8 deletions _examples/federation/reviews/graph/generated.go

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

8 changes: 4 additions & 4 deletions _examples/selection/generated.go

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

20 changes: 10 additions & 10 deletions _examples/starwars/generated/exec.go

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

8 changes: 4 additions & 4 deletions _examples/type-system-extension/generated.go

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

2 changes: 1 addition & 1 deletion codegen/interface.gotpl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ func (ec *executionContext) _{{$interface.Name}}(ctx context.Context, sel ast.Se
{{- range $implementor := $interface.Implementors }}
case {{$implementor.Type | ref}}:
if len(graphql.CollectFields(ec.OperationContext, sel, []string{"{{$interface.Type | typeName }}", "{{$implementor.Name}}"})) == 0 {
return graphql.Empty{}
return graphql.NullItem
}
{{- if $implementor.CanBeNil }}
if obj == nil {
Expand Down
Loading

0 comments on commit f1eafcb

Please sign in to comment.