graphql-python / graphql-python/graphene

Validate that a subscription query only contains 1 field

Offen
#1,227 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
✨ enhancement
Vorherrschende Sprache
Python
Sterne
8.2k
Forks
818
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Rechercherichtung

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.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
graphql, python
Bereich
api
Issue-Typ
Bug
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
45/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.