Throw when a resolver method is missing a parameter for an argument in 15.0.0
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 72/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- graphql, kotlin
- Ambito
- backend-api-design
Direzione di ricerca
Start in SchemaClassScanner#warnIfParameterMissing and read the existing warning path, then inspect MethodFieldResolverTest for the named test and the 15.0.0 release notes. Replace the warning with a FieldResolverError that preserves its message and verify it is thrown even when either resolver fallback option is enabled. Done when the test asserts the error and the release notes describe the change.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Follow-up to #418 and #890. Tools now warns at build when a resolver method is missing the parameter for an argument and has a DataFetchingEnvironment, GraphQLContext or contextClass parameter instead. The parameter count still matches, so the scanner accepts it and maps the arguments by position:
type Query {
users(first: Int): UserConnection
}
fun users(env: DataFetchingEnvironment): Connection<User>
Every query of users then fails, with Parameter specified as non-null is null: ... parameter env when first is omitted and Cannot construct instance of graphql.schema.DataFetchingEnvironment when it's sent. The build logs:
Field 'Query.users' has no parameter for its argument 'first: Int' in scenarios.ContextMisboundQuery.users, so the DataFetchingEnvironment parameter gets the argument instead. Add a parameter for each argument, in order, before the DataFetchingEnvironment parameter.
For the contextClass it only warns when the argument is a spec scalar, since the context class can also be a real argument type (e.g. contextClass(Map) with an input object mapped to a Map).
A resolver like this can't work, so it should fail the build. But a schema whose broken field is never queried builds and runs fine today, so throwing has to wait for a major release.
What to change
- replace the warning in
SchemaClassScanner#warnIfParameterMissingwith aFieldResolverErrorthat keeps the same message - throw it even with
allowUnimplementedResolversormissingResolverDataFetcherset, since the resolver exists but can't be called - turn
MethodFieldResolverTest."should warn when a resolver method is missing a parameter for an argument"into a test for the error - mention it in the 15.0.0 release notes
- 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
-
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
-
Directive wirings see a type reference on recursive input fieldsForse già presa @oryan-block l’ha presa oggi. Apertabug
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
graphql-java-kickstart/graphql-java-tools#875 ·
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