Skip to content

Commit

Permalink
new strategy
Browse files Browse the repository at this point in the history
  • Loading branch information
zzh8829 committed Feb 16, 2024
1 parent 414c3f2 commit a2a8d58
Show file tree
Hide file tree
Showing 4 changed files with 247 additions and 42 deletions.
11 changes: 11 additions & 0 deletions generate/convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -701,6 +701,17 @@ func fragmentMatches(containingTypedef, fragmentTypedef *ast.Definition) bool {
return true
}
}

// Handle the special case where the fragment is on a union, then the
// fragment can match any of the types in the union.
if fragmentTypedef.Kind == ast.Union {
for _, typeName := range fragmentTypedef.Types {
if typeName == containingTypedef.Name {
return true
}
}
}

return false
}

Expand Down

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

Loading

0 comments on commit a2a8d58

Please sign in to comment.