In 3.1.0, `resolve_type` method on Interfaces and Unions no longer supports returning the GraphQL Type as a string
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 35/100
Línea de trabajo
Empieza revisando el manejo de resolve_type modificado en la regresión de 3.1.0 descrita aquí y compáralo con el cambio propuesto en el pull request del fork enlazado. Añade una prueba unitaria que cubra un resultado de tipo GraphQL de tipo string, luego ejecuta la suite de pruebas relevante y confirma que el comportamiento funciona sin romper los resultados de Graphene Type.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
-
What is the current behavior?
As of 3.1.0, theresolve_typemethod on Interfaces and Unions no longer supports returning the GraphQL Type as a string as opposed to the actual Graphene Type. I think this might be an unintended regression from https://github.com/graphql-python/graphene/pull/1421. -
What is the expected behavior?
Our project heavily depends on resolve_type returning a string for the GraphQL Type as opposed to the Graphene Type that implements it. -
What is the motivation / use case for changing the behavior?
While it's possible to refactor most of our code to return the Graphene Type, there are some cases where it's very difficult to break circular imports. The reason for that is that some of our implementations of theresolve_typemethod delegates to returning a property of an Enum and the Enum definition can't reference the Graphene Type because the Graphene Type references the enum. -
Please tell us about your environment:
- Version: Trying to upgrade to 3.1.0.
- Platform: Python 3.12.2 on Linux
-
Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow)
I created https://github.com/perlow/graphene/pull/1 in a fork. I don't have write permission the repo to request a merge. If this looks reasonable, I can add a unit test for the behavior.
- Lenguaje dominante
- Python
- Estrellas
- 8.2k
- Forks
- 822
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
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/graphene
-
Tutorial mistakesAbierto🐛 bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
graphql-python/graphene#1389 · 5 comentarios · 2 reacciones ·
-
Support OneOf input object typesAbierto
Dificultad 4/5 3-5 días Aptitud para principiantes 68/100
graphql-python/graphene#1606 ·
-
Python 3.14 supportAbierto✨ enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 38/100
graphql-python/graphene#1601 · 2 comentarios ·
-
✨ enhancement
Dificultad 4/5 3-5 días Aptitud para principiantes 42/100
graphql-python/graphene#1600 ·
-
Inaccurate Float-to-Decimal Conversion in `parse_value` of `Decimal` `Scalar`Posiblemente ocupada @mak626 la tomó hace 607 días. Abierto🐛 bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 55/100
graphql-python/graphene#1593 ·
Todos los issues de graphql-python/graphene
Issues similares
-
Claiming namespace `jft63`Abiertonamespace operations
Dificultad 1/5 Menos de una hora Aptitud para principiantes 72/100
EclipseFdn/open-vsx.org#14043 ·
Los mantenedores suelen responder en 1 día
-
feedback simulation workshop
Dificultad 2/5 1-3 horas Aptitud para principiantes 73/100
githubnext/gh-aw-workshop#4455 ·
Los mantenedores suelen responder en 1 día
-
Triage 🩺
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
-
[BUG] Container scenario crashes without expected_recovery_time, kube DNS example uses retry_waitAbiertoneeds-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
krkn-chaos/krkn#1627 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
NousResearch/hermes-agent#136483 ·
Los mantenedores suelen responder en 1 día