Throw when a resolver method is missing a parameter for an argument in 15.0.0
Mantenedores costumam responder em até 1 dia
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 3/5
- Tempo estimado
- 1-2 dias
- Facilidade para iniciantes
- 72/100
- Tipo de issue
- Bug
- Clareza
- Claramente especificada
- Status de atividade
- Ativa
- Stack de tecnologia
- graphql, kotlin
- Domínio
- backend-api-design
Direção de pesquisa
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.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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
- Linguagem predominante
- Kotlin
- Estrelas
- 824
- Forks
- 175
- Merge médio
- 2d 5h
- PRs com merge (30d)
- 52
Preparar o ambiente
Este projeto não oferece contêiner de desenvolvimento, Dockerfile nem guia de contribuição, então a configuração fica por sua conta: comece pelo README e veja nosso guia da primeira contribuição para os passos gerais.
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de graphql-java-kickstart/graphql-java-tools
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 85/100
graphql-java-kickstart/graphql-java-tools#893 ·
Mantenedores costumam responder em até 1 dia
-
bug
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 55/100
graphql-java-kickstart/graphql-java-tools#886 ·
Mantenedores costumam responder em até 1 dia
-
Reject directives applied at the wrong location, without a required argument or twice in 15.0.0Abertaenhancement
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 72/100
graphql-java-kickstart/graphql-java-tools#884 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 48/100
graphql-java-kickstart/graphql-java-tools#881 ·
Mantenedores costumam responder em até 1 dia
-
Directive wirings see a type reference on recursive input fieldsTalvez já em andamento @oryan-block assumiu há 1 dia. Abertabug
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 35/100
graphql-java-kickstart/graphql-java-tools#875 ·
Mantenedores costumam responder em até 1 dia
Todas as issues de graphql-java-kickstart/graphql-java-tools
Issues semelhantes
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
navikt/mock-oauth2-server#1129 ·
Mantenedores costumam responder em até 1 dia
-
Expose `close` on SsrEngineAberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 77/100
-
unconfirmed
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 65/100
thunderbird/thunderbird-android#11778 · 2 comentários ·
Mantenedores costumam responder em até 1 dia
-
bug
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 88/100
software-mansion/enriched-markdown#1042 ·
Mantenedores costumam responder em até 2 dias
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 65/100
world-federation-of-advertisers/cross-media-measurement#4709 ·
Mantenedores costumam responder em até 1 dia