graphql-python / graphql-python/graphene

why use different behavior for the description of query and mutation

Abierto
#1,325 0 comentarios 0 reacciones 0 asignados Ver en GitHub
🐛 bug
Lenguaje dominante
Python
Estrellas
8.2k
Forks
818
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

* **What is the current behavior?**
Now, the query description only use the `description=...` args for docs, the description or the __doc__ in Typeclass only use for Type docs.
but the mutation use the `description` args or the description of mutation class or the __doc__ of mutation class for both mutation docs and mutation class docs.

* **What is the expected behavior?**
Both query and mutation should share the same logic for docs, first use the `description` arg of the field, then the description of meta class of class, the last is using __doc__ of (the type or mutation) class.

* **Other information** (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow)
dig into code, I find the graphene.mutation has a classmethod func named Field which return graphene.Field with `description=description or cls._meta.description`.

Guía de contribución

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

Línea de trabajo

Start by comparing the query field description handling with graphene.mutation's classmethod Field, which returns a graphene.Field using description or cls._meta.description. Trace how __doc__ and type or mutation descriptions reach the generated docs. Done means query and mutation fields follow the same documented precedence, with tests confirming the resulting descriptions.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
graphql, python
Área
api, backend-api-design
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

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.