Hacktoberfest 2026 : les issues que les mainteneurs ont marquées pour octobre, ouvertes et accessibles aux débutants. Parcourir les issues Hacktoberfest

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

Ouverte
#863 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

Personne n'a encore pris cette issue.

Évaluation

Difficulté
3/5
Temps estimé
1-2 jours
Accessibilité débutants
76/100
Type d'issue
Bug
Clarté
Clairement spécifiée
Activité
Active
Stack technique
graphql, kotlin

Piste de recherche

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.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

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
Langage dominant
Kotlin
Étoiles
824
Forks
175
Merge moyen
2 j 5 h
PR mergées (30 j)
52

Préparer son environnement

Ce projet ne fournit ni conteneur de développement, ni Dockerfile, ni guide de contribution : l'installation est à votre charge. Commencez par son README, et consultez notre guide de la première contribution pour les étapes générales.

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de graphql-java-kickstart/graphql-java-tools

Toutes les issues de graphql-java-kickstart/graphql-java-tools

Issues similaires

Plus d'issues Kotlin

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.