graphql-python / graphql-python/graphene

Multiple choice Enum Arguments

Abierto
#1,329 1 comentario 1 reacción 0 asignados Ver en GitHub
✨ enhancement
Lenguaje dominante
Python
Estrellas
8.2k
Forks
818
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

I would like to define an Argument that derives its value from an enum but can take multiple values
at the same time from the enum. so maybe like a list of enum values.

for example here is some choices that may be more than one choice at the same time and be valid in a search for ex.

```
class AgeRangeEnum(graphene.Enum):
TOD = 'TOD'
CHI = 'CHI'
PRE = 'PRE'
ADO = 'ADO'
ADU = 'ADU'
PWO = 'PWO'
SEN = 'SEN'

@property
def description(self):
if self == AgeRangeEnum.TOD:
return 'TODDLERS'
if self == AgeRangeEnum.CHI:
return 'CHILDREN'
if self == AgeRangeEnum.PRE:
return'PRETEENS'
if self == AgeRangeEnum.ADO:
return 'ADOLESCENTS'
if self == AgeRangeEnum.ADU:
return 'ADULTS'
if self == AgeRangeEnum.PWO:
return 'PREGNANTWOMEN'
if self == AgeRangeEnum.SEN:
return 'SENIORS'

....
# this is where I need help figuring out how it could take multiple values at the same time
# from the enum above.
age_range=graphene.Argument(AgeRangeEnum, required=False, default_value=''),

```

Guía de contribución

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

Línea de trabajo

The issue only provides an AgeRangeEnum example and a graphene.Argument declaration; start by tracing how enum arguments are represented and validated. Define the expected multi-value input behavior and verify it with focused coverage for the example request.

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

Evaluación

Stack tecnológico
python
Área
api
Tipo de issue
Nueva funcionalidad
Dificultad
5/5
Tiempo estimado
Más de una semana
Estado de actividad
Estancado
Claridad
Necesita aclaración
Aptitud para principiantes
30/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.