graphql-python / graphql-python/graphene
how to query EmbeddedDocumentListField in the GraphQL
- Ngôn ngữ chính
- Python
- Star
- 8.2k
- Fork
- 818
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
**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)
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Hướng nghiên cứu
Bắt đầu với ví dụ schema.py và khai báo EmbeddedDocumentListField của mô hình Column; kiểm tra schema GraphQL được tạo cho Column và so sánh với truy vấn candidateToolPairs dự kiến. gist được liên kết và các phiên bản Flask, Graphene và MongoEngine được liệt kê cung cấp bối cảnh để tái hiện. Công việc được hoàn tất khi xác định được trường này có được hỗ trợ hay không và ghi lại hành vi đã được xác minh hoặc tài liệu cần thiết.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- flask, graphql, python
- Lĩnh vực
- api, database
- Loại issue
- Lỗi
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Cần làm rõ
- Mức phù hợp với người mới
- 25/100