Validation/coercion of input variables violates the GraphQL spec
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Estancado
- Stack tecnológico
- graphql, python
- Área
- api, backend-api-design
Línea de trabajo
El issue apunta a coerce_variable_values en src/graphql/execution/values.py y al punto de entrada execute() de graphql-core. Lee primero esa función y sus llamadores; se considera terminado cuando unos variable_values no válidos hacen que se lance GraphQLError como error de la solicitud, sin ninguna entrada data en la respuesta.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
When callling graphql-core's execute() function with variable_values which do not pass validation -- for example, including an unexpected key in the variable_values dictionary -- the current behavior is that an ExecutionResult object is returned from the function, with the associated GraphQLError present inside it. Instead, this should be treated as a Request error, according to the spec, meaning that a GraphQLError should be raised from execute().
The GraphQL spec states:
Request errors
Request errors are raised before execution begins. This may occur due to a parse grammar or validation error in the requested document, an inability to determine which operation to execute, or invalid input values for variables.
This means that it is incorrect for the coerce_variable_values function to be returning a GraphQLError inside an ExecutionResult: https://github.com/graphql-python/graphql-core/blob/9dcf25e66f6ed36b77de788621cf50bab600d1d3/src/graphql/execution/values.py#L93-L99
doing so means that a response payload is returned containing both an "errors" key and a null "data" key. Again, this a violation of the spec:
If a request error is raised, execution does not begin and the data entry in the response must not be present. The errors entry must include the error.
- Lenguaje dominante
- Python
- Estrellas
- 531
- Forks
- 147
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de graphql-python/graphql-core
-
Dificultad 4/5 3-5 días Aptitud para principiantes 50/100
graphql-python/graphql-core#272 · 1 comentario ·
-
Dificultad 3/5 1-2 días Aptitud para principiantes 55/100
graphql-python/graphql-core#269 · 1 comentario ·
-
Publish a major version Abierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
graphql-python/graphql-core#267 · 1 comentario ·
-
Dificultad 3/5 1-2 días Aptitud para principiantes 45/100
graphql-python/graphql-core#257 ·
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
graphql-python/graphql-core#247 · 8 comentarios ·
Todos los issues de graphql-python/graphql-core
Issues similares
-
essnmx good first issue
Dificultad 1/5 Menos de una hora Aptitud para principiantes 95/100
-
[Feature] 奇物选择添加优先级 Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
syfoud/Simulated_Scepter#174 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Giskard-AI/giskard-oss#2840 · 1 comentario ·
-
A claim comment carrying the issue number is silently declined while the workflow reports success Abiertoarea: repo bug perceived difficulty: 2
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
yeti-platform/yeti#1380 ·