Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Directive wirings see a type reference on recursive input fields

Abierto
#875 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

@oryan-block ya está trabajando en esto.

Desde el 20/10/2026.

  • #895 de @oryan-block — abierto

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
35/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
java, kotlin

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

bug

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.

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

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de graphql-java-kickstart/graphql-java-tools

Todos los issues de graphql-java-kickstart/graphql-java-tools

Issues similares

Más issues de Kotlin

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.