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

Reject enum values, interface fields and union members that a type declares twice in 15.0.0

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

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

Línea de trabajo

Start with SchemaParser#warnRepeated, createEnumObject, and createInterfaceObject, then read the repeats covered by TypeExtensionTest.repeats and extensions without a type keep building. Move those cases into an error test and check that the SchemaError names the type and repeated value, field, or member. Update the 15.0.0 release notes; done means repeats are rejected and the tests verify the error.

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

Descripción

enhancement

Since #855, extensions are merged into the type they extend. When a type ends up declaring an enum value, interface field or union member twice, e.g. in the type and again in an extension, tools keeps the first one and logs a warning:

enum Color { RED }
extend enum Color { RED GREEN }

Type 'Color' declares value 'RED' more than once, only the first one is kept.

graphql-java's SchemaGenerator rejects these schemas, and the spec doesn't allow an extension to redeclare what the type already has. But they built before #855, since the extension used to replace the type, so failing on them has to wait for a major release.

Keeping the first one hides mistakes though. interface Node { id: ID } plus extend interface Node { id: String } builds with id: ID, and only a log line says the extension's id was dropped.

What to change
  • replace the warning in SchemaParser#warnRepeated with a SchemaError that names the type and the repeated value, field or member
  • drop the distinctBy { it.name } on the enum values in createEnumObject and the interface fields in createInterfaceObject
  • move the repeats out of TypeExtensionTest.repeats and extensions without a type keep building 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

  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.