Reject enum values, interface fields and union members that a type declares twice in 15.0.0
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
- Domaine
- backend-api-design, testing
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
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#warnRepeatedwith aSchemaErrorthat names the type and the repeated value, field or member - drop the
distinctBy { it.name }on the enum values increateEnumObjectand the interface fields increateInterfaceObject - move the repeats out of
TypeExtensionTest.repeats and extensions without a type keep buildinginto 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
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de graphql-java-kickstart/graphql-java-tools
-
Difficulté 2/5 1-3 heures Accessibilité débutants 85/100
graphql-java-kickstart/graphql-java-tools#893 ·
Les mainteneurs répondent en général sous 1 jour
-
bug
Difficulté 3/5 1-2 jours Accessibilité débutants 74/100
graphql-java-kickstart/graphql-java-tools#896 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 3/5 1-2 jours Accessibilité débutants 72/100
graphql-java-kickstart/graphql-java-tools#889 ·
Les mainteneurs répondent en général sous 1 jour
-
bug
Difficulté 3/5 1-2 jours Accessibilité débutants 55/100
graphql-java-kickstart/graphql-java-tools#886 ·
Les mainteneurs répondent en général sous 1 jour
-
Reject directives applied at the wrong location, without a required argument or twice in 15.0.0Ouverteenhancement
Difficulté 3/5 1-2 jours Accessibilité débutants 72/100
graphql-java-kickstart/graphql-java-tools#884 ·
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de graphql-java-kickstart/graphql-java-tools
Issues similaires
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 70/100
beppe2880/opencode-mobile#60 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
auth0/Auth0.Android#1101 ·
Les mainteneurs répondent en général sous 1 jour
-
LiquidGlass / LiquidGlassContainer (iOS): padded content measured at the outer width and overflows by the paddingPeut-être pris @aleclarson l’a pris aujourd’hui. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 74/100
NativeScript/NativeScript#11561 ·
Les mainteneurs répondent en général sous 1 jour
-
Imported configuration's @Bean methods record the configuration class instead of the return typeOuvertein:spring-core
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
explyt/spring-plugin#787 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 84/100
IacobIonut01/ReFra#1335 ·
Les mainteneurs répondent en général sous 4 jours