Validation/coercion of input variables violates the GraphQL spec
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 停滞
- 技術スタック
- graphql, python
調査の方向性
この issue は src/graphql/execution/values.py の coerce_variable_values と、graphql-core のエントリーポイントである execute() を指しています。まずその関数と呼び出し元を読みます。完了条件は、無効な variable_values によってリクエストエラーとして GraphQLError が送出され、レスポンスに data エントリが含まれないことです。
索引モデルが issue の本文から書いたものです。
説明
When callling graphql-core's execute() function with variable_values which do not pass validation -- for example, including an unexpected key in the variable_values dictionary -- the current behavior is that an ExecutionResult object is returned from the function, with the associated GraphQLError present inside it. Instead, this should be treated as a Request error, according to the spec, meaning that a GraphQLError should be raised from execute().
The GraphQL spec states:
Request errors
Request errors are raised before execution begins. This may occur due to a parse grammar or validation error in the requested document, an inability to determine which operation to execute, or invalid input values for variables.
This means that it is incorrect for the coerce_variable_values function to be returning a GraphQLError inside an ExecutionResult: https://github.com/graphql-python/graphql-core/blob/9dcf25e66f6ed36b77de788621cf50bab600d1d3/src/graphql/execution/values.py#L93-L99
doing so means that a response payload is returned containing both an "errors" key and a null "data" key. Again, this a violation of the spec:
If a request error is raised, execution does not begin and the data entry in the response must not be present. The errors entry must include the error.
- 主要言語
- Python
- スター
- 531
- フォーク
- 147
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
graphql-python/graphql-core のほかの issue
-
難易度 4/5 3〜5日 初心者へのやさしさ 50/100
graphql-python/graphql-core#272 · コメント 1 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
graphql-python/graphql-core#269 · コメント 1 件 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
graphql-python/graphql-core#267 · コメント 1 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
graphql-python/graphql-core#257 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
graphql-python/graphql-core#247 · コメント 8 件 ·
graphql-python/graphql-core の issue をすべて見る
似ている issue
-
essnmx good first issue
難易度 1/5 1時間未満 初心者へのやさしさ 95/100
-
[Feature] 奇物选择添加优先级 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
syfoud/Simulated_Scepter#174 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
Giskard-AI/giskard-oss#2840 · コメント 1 件 ·
-
A claim comment carrying the issue number is silently declined while the workflow reports success オープンarea: repo bug perceived difficulty: 2
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
yeti-platform/yeti#1380 ·