graphql-python / graphql-python/graphene

Validate that a subscription query only contains 1 field

Ouverte
#1,227 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
✨ enhancement
Langage dominant
Python
Étoiles
8.2k
Forks
818
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

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

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Piste de recherche

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.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
graphql, python
Domaine
api
Type d'issue
Bug
Difficulté
3/5
Temps estimé
1-2 jours
Activité
À l'abandon
Clarté
Plutôt claire
Accessibilité débutants
45/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.