Skip to content

Commit

Permalink
Run tests to reset federation testdata
Browse files Browse the repository at this point in the history
Signed-off-by: Steve Coffman <steve@khanacademy.org>
  • Loading branch information
StevenACoffman committed Dec 15, 2024
1 parent fee5609 commit b0fbf6d
Show file tree
Hide file tree
Showing 10 changed files with 219 additions and 213 deletions.
6 changes: 3 additions & 3 deletions _examples/federation/accounts/graph/federation.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/federation/products/graph/federation.go

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

14 changes: 7 additions & 7 deletions _examples/federation/reviews/graph/federation.go

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

8 changes: 4 additions & 4 deletions plugin/federation/federation.gotpl
Original file line number Diff line number Diff line change
Expand Up @@ -310,12 +310,12 @@ func (ec *executionContext) resolveManyEntities(
{{- range $i, $field := .Field }}
val, ok = m["{{.}}"]
if !ok {
return "", fmt.Errorf("%w due to missing Key Field {{.}} for User", ErrTypeNotFound)
return "", fmt.Errorf("%w due to missing Key Field \"{{.}}\" for {{$entity.Name}}", ErrTypeNotFound)
}
{{- if (ne $i $keyField.Field.LastIndex ) }}
if m, ok = val.(map[string]interface{}); !ok {
// nested field value is not a map[string]interface
return "", fmt.Errorf("%w for {{$entity.Name}} due to nested Keyfield not being map value", ErrTypeNotFound)
// nested field value is not a map[string]interface so don't use it
break
}
{{- else}}
if allNull {
Expand All @@ -325,7 +325,7 @@ func (ec *executionContext) resolveManyEntities(
{{- end}}
{{- end }}
if allNull {
return "", fmt.Errorf("%w due to all null value KeyFields for User", ErrTypeNotFound)
return "", fmt.Errorf("%w due to all null value KeyFields for {{$entity.Name}}", ErrTypeNotFound)
}
return "{{.ResolverName}}", nil
}
Expand Down
60 changes: 33 additions & 27 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.

Loading

0 comments on commit b0fbf6d

Please sign in to comment.