Skip to content

Commit

Permalink
Fix issue 99designs#2470
Browse files Browse the repository at this point in the history
  • Loading branch information
Roman A. Grigorovich committed Dec 14, 2022
1 parent 3008f4e commit 1a9a41b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion codegen/field.gotpl
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ func (ec *executionContext) _{{$object.Name}}_{{$field.Name}}(ctx context.Contex
})
if err != nil {
ec.Error(ctx, err)
return {{ $null }}
{{- if not $object.Root }}
return {{ $null }}
{{- end }}
}
{{- end }}
if resTmp == nil {
Expand Down
4 changes: 3 additions & 1 deletion codegen/object.gotpl
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,9 @@ func (ec *executionContext) _{{$object.Name}}(ctx context.Context, sel ast.Selec
}
}
out.Dispatch()
if invalids > 0 { return graphql.Null }
{{- if not $object.Root }}
if invalids > 0 { return graphql.Null }
{{- end }}
return out
}
{{- end }}
Expand Down

0 comments on commit 1a9a41b

Please sign in to comment.