Reject directives applied at the wrong location, without a required argument or 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
- 72/100
- Type d'issue
- Bug
- Clarté
- Clairement spécifiée
- Activité
- Active
- Domaine
- backend-api-design, release, testing
Piste de recherche
Start with SchemaParser#directiveProblems and SchemaParser#directivesOf, then read DirectiveTest.should warn about invalid applied directives and keep them. Replace the warnings with SchemaError using the same messages, and cover the type extension case for duplicate non-repeatable directives. Update the 15.0.0 release notes; done when invalid applications fail with the expected errors and the test and release notes describe the change.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Since #225, tools logs a warning when a schema applies a directive in a way its definition doesn't allow, and still builds the schema:
directive @uppercase on OBJECT
directive @auth(role: String!) on FIELD_DEFINITION
directive @cached(ttl: Int) on FIELD_DEFINITION
type Query {
motto: String @uppercase
secret: String @auth
members: [Member!] @cached @cached(ttl: 10)
}
Directive @uppercase is applied to field 'Query.motto', but it's declared on OBJECT, not FIELD_DEFINITION.
Directive @auth is applied to field 'Query.secret' without its required argument 'role'.
Directive @cached isn't repeatable but is applied more than once to field 'Query.members'.
graphql-java's SchemaGenerator rejects all three, and the spec doesn't allow them either. But they always built with tools, so failing on them has to wait for a major release.
What to change
- replace the warnings from
SchemaParser#directiveProblemswith aSchemaErrorthat has the same messages - probably do the same for the warning in
SchemaParser#directivesOf, when a type extension applies a non-repeatable directive the type already has. It's the same mistake, it just drops the repeat today - turn
DirectiveTest.should warn about invalid applied directives and keep theminto 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
-
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
-
Difficulté 4/5 3-5 jours Accessibilité débutants 48/100
graphql-java-kickstart/graphql-java-tools#881 ·
Les mainteneurs répondent en général sous 1 jour
-
Directive wirings see a type reference on recursive input fieldsPeut-être pris @oryan-block l’a pris il y a 1 jour. Ouvertebug
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 35/100
graphql-java-kickstart/graphql-java-tools#875 ·
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 78/100
navikt/mock-oauth2-server#1129 ·
Les mainteneurs répondent en général sous 1 jour
-
Expose `close` on SsrEngineOuverte
Difficulté 2/5 1-3 heures Accessibilité débutants 77/100
-
Difficulté 2/5 1-3 heures Accessibilité débutants 65/100
world-federation-of-advertisers/cross-media-measurement#4709 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 70/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 82/100
mikepenz/AboutLibraries#1488 · 2 commentaires ·
Les mainteneurs répondent en général sous 1 jour