graphql-python / graphql-python/graphene

how to query EmbeddedDocumentListField in the GraphQL

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

説明

**Note: for support questions, please use stackoverflow**. This repository's issues are reserved for feature requests and bug reports.

* **What is the current behavior?**
EmbeddedDocumentListField can't be queried and I couldn't find anything in the documentation.
I get the following error `"Cannot query field \"candidateToolPairs\" on type \"Column\".",`

Code gist is available: https://gist.github.com/ahmad88me/d489b8aa87e71d24e28606e5b502ab28

``` # schema.py
class Column(MongoengineObjectType):
class Meta:
model = ColumnModel
interfaces = (Node,)
```
with the model class `Column` include `candidate_tool_pairs = EmbeddedDocumentListField(ToolCandidatePair)`

In the graphQL interface, all the field of the class Column loads successfully, but the field `candidate_tool_pairs` (I tried candidateToolPairs as well. Also nothing starts with candidate is suggested by the autocomplete).

Instead, I get the following error: `"Cannot query field \"candidateToolPairs\" on type \"Column\".",`

* **What is the expected behavior?**
To get the list candidateToolPairs

* **Please tell us about your environment:**
```Flask==1.1.2
Flask-GraphQL==2.0.1
graphene==2.1.8
graphene-mongo==0.2.13
graphql-core==2.3.2
graphql-relay==2.0.1
graphql-server-core==1.2.0
mongoengine==0.19.1
pymongo==3.11.0```

* **Other information** (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow)

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

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

調査の方向性

schema.pyの例と、ColumnモデルのEmbeddedDocumentListField宣言から始め、Column用に生成されたGraphQLスキーマを調べ、期待されるcandidateToolPairsクエリと比較します。リンクされたgistと記載されているFlask、Graphene、MongoEngineのバージョンが、再現のためのコンテキストを提供します。フィールドがサポートされているかどうかを判断し、検証済みの動作または必要なドキュメントを記録できれば完了です。

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

評価

技術スタック
flask, graphql, python
領域
api, database
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
25/100

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

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