graphql-python / graphql-python/graphene

Validate that a subscription query only contains 1 field

オープン
#1,227 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
✨ enhancement
主要言語
Python
スター
8.2k
フォーク
818
PR マージ指標
30日以内にマージされた PR はありません

説明

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

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

評価

技術スタック
graphql, python
領域
api
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
45/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。