Directive wirings see a type reference on recursive input fields
I maintainer di solito rispondono entro 1 giorno
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 35/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Ambito
- backend-api-design
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- Kotlin
- Stelle
- 824
- Fork
- 175
- Merge medio
- 2g 5h
- PR unite (30g)
- 52
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di graphql-java-kickstart/graphql-java-tools
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
graphql-java-kickstart/graphql-java-tools#893 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 72/100
graphql-java-kickstart/graphql-java-tools#889 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 55/100
graphql-java-kickstart/graphql-java-tools#886 ·
I maintainer di solito rispondono entro 1 giorno
-
Reject directives applied at the wrong location, without a required argument or twice in 15.0.0Apertaenhancement
Difficoltà 3/5 1-2 giorni Idoneità per principianti 72/100
graphql-java-kickstart/graphql-java-tools#884 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
graphql-java-kickstart/graphql-java-tools#881 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di graphql-java-kickstart/graphql-java-tools
Issue simili
-
area/kotlin
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
good first issue help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
dafonton77-tech/Cadreenf#11 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100
Hy4ri/hermes-mobile#1647 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
supabase-community/supabase-kt#1429 ·
I maintainer di solito rispondono entro 5 giorni