Skip to content

Commit

Permalink
Try generation 99designs#2
Browse files Browse the repository at this point in the history
  • Loading branch information
Siong Leng committed May 12, 2023
1 parent d7b0df9 commit e8a3fdf
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 39 deletions.
2 changes: 1 addition & 1 deletion plugin/federation/federation.gotpl
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ func (ec *executionContext) __resolve_entities(ctx context.Context, representati
{{ range $i, $resolver := .Resolvers }}
case "{{.ResolverName}}":
{{- range $j, $keyField := .KeyFields }}
if rep["{{.Field.Join `"] != nil {
if rep["{{$keyField.Field}}"] != nil {
id{{$j}}, err := ec.{{.Type.UnmarshalFunc}}(ctx, rep["{{.Field.Join `"].(map[string]interface{})["`}}"])
if err != nil {
return fmt.Errorf(`unmarshalling param {{$j}} for {{$resolver.ResolverName}}(): %w`, err)
Expand Down
90 changes: 56 additions & 34 deletions plugin/federation/testdata/allthethings/generated/federation.go

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

10 changes: 6 additions & 4 deletions plugin/federation/testdata/federation2/generated/federation.go

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

0 comments on commit e8a3fdf

Please sign in to comment.