graphql-python / graphql-python/graphene
Field names in validation errors are different from schema
- Lenguaje dominante
- Python
- Estrellas
- 8.2k
- Forks
- 818
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
I have a form which has a python field `raw_description` which ends up in schema as `rawDescription`. However if field doesn't have a valid value I get a validation error for field `raw_description` which is not in schema.
```python
class UpdateEventModelForm(forms.ModelForm):
raw_description = forms.CharField()
class Meta:
model = EventModel
fields = ('name', 'from_date', 'to_date')
```
```graphql
mutation updateEvent($input: UpdateEventInput!) {
updateEvent(input: $input) {
errors {
field
messages
}
}
}
{
"input": {
"id": 123,
"rawDescription": ""
}
}
```
Response
```json
{
"data": {
"updateEvent": {
"errors": [
{
"field": "raw_description",
"messages": [
"This field is required."
]
}
],
"event": null
}
}
}
```
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Línea de trabajo
No file or test is named in the issue. Start by tracing how Python form validation errors are converted into GraphQL responses, using the supplied raw_description/rawDescription reproduction; done means the returned error field uses the schema's rawDescription name.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- graphql, python
- Área
- api
- Tipo de issue
- Error
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 45/100