Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

Unions that list each other fail with a StackOverflowError

Offen
#886 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
55/100
Issue-Typ
Bug
Klarheit
Größtenteils klar
Aktivitätsstatus
Aktiv
Tech-Stack
graphql, kotlin
Bereich
api, backend

Rechercherichtung

Start by reading SchemaParser#getLeafUnionObjects and trace how nested union members are expanded; the issue identifies the recursive expansion as the source of the StackOverflowError. Reproduce with the mutual and self-referencing schemas shown in the issue, including a field that returns the inner union. Done when those schemas no longer overflow and the invalid union membership is handled consistently with the chosen behavior.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

bug

Two unions that list each other fail the schema build with a StackOverflowError:

type Query {
    results: [Result!]!
}

union Result = Book | Media

union Media = 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.

Vorherrschende Sprache
Kotlin
Sterne
824
Forks
175
Ø Merge
2 T. 5 Std.
Gemergte PRs (30 T.)
52

Entwicklungsumgebung

Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus graphql-java-kickstart/graphql-java-tools

Alle Issues in graphql-java-kickstart/graphql-java-tools

Ähnliche Issues

Weitere Issues zu Kotlin

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.