Throw at build for resolvers that can't be called on their JDK dynamic proxy in 15.0.0
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 76/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- graphql, kotlin, spring
- Área
- backend-api-design, release, testing
Línea de trabajo
Read SchemaClassScanner#warnIfNotCallableOnResolver and the existing FieldResolverError implementation to see how resolver errors are reported. Update SchemaParserTest's “parser handles spring AOP proxied resolvers by default” test to verify the error, including when the resolver fallback options are enabled. Add the change to the 15.0.0 release notes; done means the warning becomes an error with the same message and the tests pass.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Since #853, tools warns at build when a resolver is a JDK dynamic proxy (e.g. Spring AOP with proxyTargetClass = false) and a field resolves to a method or public field the proxy can't call. Spring4AopProxyHandler makes the scanner match fields against the target class, but the proxy only implements the target's interfaces, so every query of those fields fails:
class ProxiedQuery : GraphQLQueryResolver {
fun test() = "ok"
}
val resolver = ProxyFactory(ProxiedQuery()).proxy as GraphQLQueryResolver
object of type jdk.proxy2.$Proxy2 is not an instance of ProxiedQuery
For a public field it's Can not get final int field ProxiedQuery.count on jdk.proxy2.$Proxy2. For a field, the message says to add a getter as well, since class-based proxies don't pass field reads to the target either. The build logs this once per field:
Field 'Query.test' resolves to scenarios.ProxiedQuery.test, but the resolver is a jdk.proxy2.$Proxy2, which isn't a scenarios.ProxiedQuery, so every query of the field will fail. This happens with JDK dynamic proxies, which only implement interfaces. Use class-based proxies instead, e.g. proxyTargetClass = true in Spring.
A field that can never work 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#warnIfNotCallableOnResolverwith aFieldResolverErrorthat keeps the same message - throw it even with
allowUnimplementedResolversormissingResolverDataFetcherset, since the resolver exists but can't be called - turn
SchemaParserTest."parser handles spring AOP proxied resolvers by default", which only builds today, into a test for the error - mention it in the 15.0.0 release notes
- Lenguaje dominante
- Kotlin
- Estrellas
- 824
- Forks
- 175
- Merge medio
- 2 d 5 h
- PR fusionados (30 d)
- 52
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de graphql-java-kickstart/graphql-java-tools
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
graphql-java-kickstart/graphql-java-tools#893 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 3/5 1-2 días Aptitud para principiantes 74/100
graphql-java-kickstart/graphql-java-tools#896 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 3/5 1-2 días Aptitud para principiantes 72/100
graphql-java-kickstart/graphql-java-tools#889 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 3/5 1-2 días Aptitud para principiantes 55/100
graphql-java-kickstart/graphql-java-tools#886 ·
Los mantenedores suelen responder en 1 día
-
Reject directives applied at the wrong location, without a required argument or twice in 15.0.0Abiertoenhancement
Dificultad 3/5 1-2 días Aptitud para principiantes 72/100
graphql-java-kickstart/graphql-java-tools#884 ·
Los mantenedores suelen responder en 1 día
Todos los issues de graphql-java-kickstart/graphql-java-tools
Issues similares
-
enhancement impact:U1 P3 reach:R2 size:S
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 73/100
ankidroid/Anki-Android#22677 ·
Los mantenedores suelen responder en 1 día
-
Type Pick Request
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
reactwg/react-native-releases#1456 · 1 comentario ·
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
yschimke/homeassistant-remotecompose#1038 ·
Los mantenedores suelen responder en 1 día
-
area:data-quality importer size:S
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
enorm-labs/event-junkie#3707 ·
Los mantenedores suelen responder en 1 día