Directive wirings see a type reference on recursive input fields
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
調査の方向性
Start by comparing this schema's directive wiring during type construction with graphql-java's SchemaGenerator behavior described in the issue; the issue names no source files or tests. Reproduce the recursive Tree input case and confirm the GraphQLTypeReference seen for and. Done means directive wiring runs after schema assembly and recursive fields expose the resolved input type across the affected object, interface, union, enum, and input object cases.
索引モデルが issue の本文から書いたものです。
説明
A SchemaDirectiveWiring that looks at the type of a recursive input field gets a GraphQLTypeReference instead of the input object:
directive @check on INPUT_FIELD_DEFINITION
type Query {
trees(filter: Tree): Int
}
input Tree {
and: [Tree!] @check
name: String @check
}
In onInputObjectField, GraphQLTypeUtil.unwrapAll(element.type) is a GraphQLTypeReference for and (name is a GraphQLScalarType as expected). The same schema and wiring through plain graphql-java's SchemaGenerator gives a GraphQLInputObjectType for and.
So any wiring that walks input types and calls unwrapAll fails with ClassCastException: GraphQLTypeReference cannot be cast to GraphQLUnmodifiedType. I believe that includes graphql-java-extended-validation's DirectivesAndTypeWalker, but I haven't run it against this schema.
#843 fixed the non-recursive case (input objects behind a list or non-null wrapper) and left cycles out. Types are immutable, so one field of a cycle has to stay a reference while the type is being built. graphql-java only runs directive wirings once the whole schema is assembled, so its wirings never see that reference. Ours run while types are being built, so they do.
The fix is probably to hold off all directive wiring until the schema is assembled. That touches objects, interfaces, unions and enums too, not just input objects. I haven't prototyped it.
Not the same as #36 or #450. Those were about recursive inputs not building at all, and that's fixed.
- 主要言語
- Kotlin
- スター
- 824
- フォーク
- 175
- 平均マージ
- 2日 5時間
- マージ済み PR(30日)
- 52
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
graphql-java-kickstart/graphql-java-tools のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
graphql-java-kickstart/graphql-java-tools#893 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 72/100
graphql-java-kickstart/graphql-java-tools#889 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
graphql-java-kickstart/graphql-java-tools#886 ·
メンテナーはふだん 1 日以内に返信
-
Reject directives applied at the wrong location, without a required argument or twice in 15.0.0オープンenhancement
難易度 3/5 1〜2日 初心者へのやさしさ 72/100
graphql-java-kickstart/graphql-java-tools#884 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
graphql-java-kickstart/graphql-java-tools#881 ·
メンテナーはふだん 1 日以内に返信
graphql-java-kickstart/graphql-java-tools の issue をすべて見る
似ている issue
-
area/kotlin
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
good first issue help wanted
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
dafonton77-tech/Cadreenf#11 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 80/100
Hy4ri/hermes-mobile#1647 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
supabase-community/supabase-kt#1429 ·
メンテナーはふだん 5 日以内に返信