You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Unions that list each other fail with a StackOverflowError #886
Two unions that list each other fail the schema build with a StackOverflowError:
typeQuery {
results: [Result!]!
}
unionResult = Book | MediaunionMedia = Movie | Result
Same for a union that lists itself (union Result = Book | Result).
SchemaParser#getLeafUnionObjects expands nested unions recursively and doesn't keep track of the ones it already expanded. On master this only happens when some field returns the inner union, or for the self-member case. Otherwise the scanner fails first with "No object type found". After #866 the scanner gets past that, so the first schema above overflows too.
The spec doesn't allow unions as members at all, so I think either flattening each union once (both would be Book | Movie) or failing with an error that names the unions is fine. Probably the error, since nobody asked for cycles.
Activity