graphql-python / graphql-python/graphql-core

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

Abierto
#122 2 comentarios 1 reacción 1 asignado Reclamado por @Cito Ver en GitHub
pending upstream
Lenguaje dominante
Python
Estrellas
531
Forks
146
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

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.

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.