Skip to content

Commit

Permalink
raise panic when nested @requires are used on federation (#1655)
Browse files Browse the repository at this point in the history
  • Loading branch information
vvakame committed Oct 13, 2021
1 parent f6c35be commit 6758654
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion plugin/federation/federation.go
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,12 @@ func (f *federation) setEntities(schema *ast.Schema) {
if dir == nil {
continue
}
fields := strings.Split(dir.Arguments[0].Value.Raw, " ")
args := dir.Arguments[0].Value.Raw
if strings.Contains(args, "{") {
// TODO: see. https://github.com/99designs/gqlgen/issues/1138
panic("Nested fields are not currently supported in @requires declaration.")
}
fields := strings.Split(args, " ")
requireFields := []*RequireField{}
for _, f := range fields {
requireFields = append(requireFields, &RequireField{
Expand Down

0 comments on commit 6758654

Please sign in to comment.