v15: unwrap nested return values exactly the way the schema build matched them
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Anfängerfreundlichkeit
- 35/100
- Issue-Typ
- Feature
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Aktiv
- Bereich
- backend-api-design, testing
Rechercherichtung
Start with TypeClassMatcher, ReturnValueUnwrapper, and NestedGenericWrapperTest; trace how the matcher records wrappers and how the data fetcher unwraps values. Add the custom scalar and nested Future cases described here, then confirm the matcher’s accepted return types still resolve and the nested Future produces the top-level error. The issue also calls for a release note for each behavior change.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
#903 made generic wrappers and futures nested in lists and other wrappers work at runtime, but it had to keep everything that works on 14.x working. That left a few spots where the schema build and the runtime still don't agree. Fixing them changes behaviour for some apps, so they should go in 15.0.0.
-
Share the walk.
ReturnValueUnwrapperrepeats the orderTypeClassMatcher.matchunwraps in (generic wrappers,DataFetcherResult,Optional, non-null, list elements) instead of sharing it. Right now onlyNestedGenericWrapperTestkeeps the two in step (every return type up to 4 deep that the matcher accepts has to resolve). Instead the matcher should record what it unwrapped, and the data fetcher should replay that. That also fixes a wrapper that only a customschemaWrapperintroduces, which today gets no nested unwrapping. -
Custom scalars. They're exempt, so a
Coercingkeeps getting what it gets today. Which means[DateTime]fromList<CompletableFuture<OffsetDateTime>>passes the schema build and then hands the futures to the scalar. Breaking for aCoercingthat unwraps them itself. -
Nested futures graphql-java can't wait on.
List<Future<Item>>(not aCompletionStage) passes through as is and fails withExpected source object to be an instance of 'Item' but instead got 'java.util.concurrent.FutureTask'
unless the app's
ValueUnboxercallsget(). It should fail with the same error the top level already gives. Breaking for those unboxers, and the fix on their side is to return aCompletableFuture. -
Picking a nested wrapper. We pick it by instance, the same as the outermost one. Picking by declared type would follow what the matcher resolved more closely. I'm not sure it's worth the change, since it only matters when the instance is a subclass registered as a different wrapper 🤔
-
The resolver's own future. A future directly inside a non-future wrapper (
Try<CompletableFuture<X>>) gets no step, only so graphql-java gets the exact future the resolver returned. Dropping that rule (isFutureReturnedByWrapperBefore) would hand it an equal future derived from it instead. Only breaking for someone who compares the instance.
Each one needs a line in the release notes.
resolves every return type the matcher accepts in NestedGenericWrapperTest should stay after this, since it checks the behaviour and not the copy. It should get a custom scalar leaf (2) and Future as a container with the error expected (3).
- Vorherrschende Sprache
- Kotlin
- Sterne
- 824
- Forks
- 175
- Ø Merge
- 2 T. 1 Std.
- Gemergte PRs (30 T.)
- 59
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
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus graphql-java-kickstart/graphql-java-tools
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 85/100
graphql-java-kickstart/graphql-java-tools#893 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 48/100
graphql-java-kickstart/graphql-java-tools#900 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 72/100
graphql-java-kickstart/graphql-java-tools#889 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Reject directives applied at the wrong location, without a required argument or twice in 15.0.0Offenenhancement
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 72/100
graphql-java-kickstart/graphql-java-tools#884 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 48/100
graphql-java-kickstart/graphql-java-tools#881 ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in graphql-java-kickstart/graphql-java-tools
Ähnliche Issues
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
software-mansion/enriched-markdown#1084 ·
Maintainer antworten meist innerhalb von 2 Tagen
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
lysine-dev/okhttp#9814 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
getdictus/dictus-android#187 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 79/100
bryangerlach/rdgen#319 ·