graphql-python / graphql-python/graphql-core

When enum is used as argument, its default value is not validated against enum definition

Aperta
#122 2 commenti 1 reazione 1 assegnatario Rivendicata da @Cito Vedi su GitHub
pending upstream
Lingua principale
Python
Stelle
531
Fork
146
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

Hello!

While working on enum support in Ariadne I've found that enums values aren't validated against GraphQL enum when they are defined as fields on GraphQL schema.

Following schema passes validation:

```graphql
enum Role {
ADMIN
USER
}

type Query {
hello(r: Role = ADMIN): String
complex(i: Test = { role: INVALID }): String
complexAlt(i: Test): String
}

input Test {
ignore: String
role: Role = INVALID
}
```

I would've expected schema validators to raise `INVALID`, but instead those fields are quietly excluded from default value passed to field's resolver.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.