graphql-python / graphql-python/graphql-core-legacy

Pass field names more accessibly to object resolvers

オープン
#160 コメント 2 件 リアクション 5 件 担当者 0 名 GitHub で見る
主要言語
Python
スター
372
フォーク
175
PR マージ指標
30日以内にマージされた PR はありません

説明

Currently, if you want to look at the set of fields being requested by a child object in a resolver, you have to look deep in the AST, with an expression like this:

```
(field.name.value for field in info.field_asts[0].selection_set.selections)
```

It would be nice if these names were attached directly to the `info` object, even as a property, so that things like database column selection are easier to implement.

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

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

調査の方向性

まず、info.field_asts がどのように設定され、object resolvers に公開されているかを追跡し、次に selection_set.selections 周辺の resolver コンテキストを調査します。深い AST トラバーサルを必要とせずに、要求されたフィールド名を利用可能にできる箇所を特定します。完了の条件は、resolver が info から子フィールド名を直接取得でき、想定されるデータベース列選択のユースケースをカバーできることです。

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

評価

技術スタック
python
領域
api, backend
issue の種類
機能追加
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

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

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