Have required and NonNull true by default at the project level
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 32/100
Línea de trabajo
Comienza rastreando cómo se determinan actualmente los valores predeterminados required y NonNull para los campos y las consultas de listas, y luego identifica el punto de entrada de configuración a nivel de proyecto descrito en la solicitud. Aclara cómo required=false explícito y los tipos de lista nullable u opcionales deberían sobrescribir los nuevos valores predeterminados, y añade cobertura para esos casos antes de considerar completa la funcionalidad.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Is your feature request related to a problem? Please describe.
I'm always frustrated when I have to explicitly set required a List field, or any field for that matter. It makes for really frustrating usage of our APIs that rely on typescript types generated by our graphene schema. We have to constantly add unnecessary checks and write more obtuse code just to satisfy our types. On top of that, the way that this typing is done both in python(pyright and I believe others) and in typescript are the exact opposite, you explicitly define that something can be optional. This makes it extremely unintuitive and hard to spot issues until the api starts getting use from our typescript apps.
Describe the solution you'd like
A setting at the root level to have required default to true always se we have to explicitly set required to false. This would also apply to NonNull for list queries which might need a Nullable, or Optional, or allow the required argument for type to work with the list.
Describe alternatives you've considered
I can build new types that extend the existing types and add a linter to make sure none of the original types are being used in future development. It's doable, and I'll end up doing it, but the solution I'm suggesting doesn't feel that farfetched to put in for others who may have this frustration.
Additional context
In typescript if I want to type as an array I can use Array, or [], and it will be an array, it wont expect null and it wont expect undefined. I have to be explicit if the value is nullable or undefined. Similarly in python, with pyright at least, you also have to be making sure to be explicit that the type is optional or nullable.
I'm at the very least curious why required is defaulted to false in the first place.
- 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 ·
-
✨ enhancement
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
graphql-python/graphene#1609 ·
-
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 ·
Todos los issues de graphql-python/graphene
Issues similares
-
md/asciidoc/csv: an explicit `encoding="utf-8"` keeps a leading BOM, the auto-detect path drops itAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
docling-project/docling#4846 ·
Los mantenedores suelen responder en 1 día
-
area/sessions comp/dashboard comp/desktop comp/gateway comp/tui duplicate P2 sweeper:risk-session-state type/bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
NousResearch/hermes-agent#138914 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
bot-triaged module: activation checkpointing module: inductor oncall: pt2 triaged
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
Los mantenedores suelen responder en 1 día
-
[oblt-aw][autodoc] Update PR Actions Detective E2E prerequisites and fix dashboard-format table typoAbiertodocumentation
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
elastic/oblt-aw#2382 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
Los mantenedores suelen responder en 1 día