unwrap nested return values exactly the way the schema build matched them in 15.0.0
メンテナーはふだん 1 日以内に返信
関連するプルリクエストがすでにマージされています。
- #918 @oryan-block による — マージ済み
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 35/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
#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).
- 主要言語
- Kotlin
- スター
- 824
- フォーク
- 175
- 平均マージ
- 1日 10時間
- マージ済み PR(30日)
- 86
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
似ている issue
-
Messages: Subscribe to the new communication websocket topics対応中かも @krusche が今日担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
ls1intum/artemis-android#801 ·
メンテナーはふだん 1 日以内に返信
-
Bug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
keiyoushi/extensions-source#20362 ·
メンテナーはふだん 1 日以内に返信
-
enhancement good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
enhancement good first issue
難易度 1/5 1〜3時間 初心者へのやさしさ 85/100
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
software-mansion/enriched-markdown#1084 ·
メンテナーはふだん 2 日以内に返信