graphql-python / graphql-python/graphene
Validate that a subscription query only contains 1 field
- Lenguaje dominante
- Python
- Estrellas
- 8.2k
- Forks
- 818
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
The way that GraphQL-core implements subscriptions means that if you make a subscription query with more than 1 field in it only the resolver for the first field will be called. See: graphql-python/graphql-core@3267c4c/src/graphql/subscription/subscribe.py#L147-L151
There should be some validation on the `subscribe` method on the `Schema` class to make sure that 1 field is only ever passed to a subscription query to prevent confusion.
See https://github.com/graphql-python/graphene/pull/1107#issuecomment-657194024
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Línea de trabajo
Start with the Schema class's subscribe method and compare its behavior with graphql-core's subscribe.py at lines 147-151. Determine how a subscription query with multiple fields is currently handled, then add validation so only one field is accepted and verify the resulting behavior with the repository's existing tests.
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