0xPlaygrounds / 0xPlaygrounds/subgrounds
Handle graph errors with grace
- Ngôn ngữ chính
- Python
- Star
- 73
- Fork
- 12
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
**Is your feature request related to a problem? Please describe.**
When the Graph returns with an error model, I'd like Subgrounds to present those errors better so I can handle them in my project
**Describe the solution you'd like**
I'd like Graph Node / GraphQL Errors to be properly modeled (based on the "errors") field.
Potentially, I'd like special behavior such as retry policies and query tweaking to fix those errors automagically.
**Describe alternatives you've considered**
Not handling errors.
**Additional context**
We can leverage the exact error models from the graph_node. Helpful Links:
- [helpers/graph_errors.py](https://github.com/0xPlaygrounds/Maestro/blob/main/maestro/common/common/helpers/graph_errors.py)
- Contains code to prase errors from the Graph into error models
- [models/thegraph.py](https://github.com/0xPlaygrounds/Maestro/blob/main/maestro/common/common/models/thegraph.py)
- Contains models for errors that can be returned by a graph node
- [constants/__init__.py](https://github.com/0xPlaygrounds/Maestro/blob/main/maestro/common/common/constants/__init__.py)
- Contains regex for graph errors
- [graph-node ... / error.rs](https://github.com/graphprotocol/graph-node/blob/master/graph/src/data/query/error.rs)
- Contains all errors that can be returned by a Graph node
**Implementation checklist**
- [ ] Reimplement Graph error models in pydantic
- [ ] Maybe generate protobuf or even import rust enums into python thru ✨ magic ✨
- [ ] Package errors when using client methods
- [ ] Integrate with `PaginationStrategy`
Hướng dẫn đóng góp
Hướng nghiên cứu
Start by examining the linked helper file graph_errors.py and models/thegraph.py in the Maestro repository to understand existing error parsing and models. Review the Graph Node error.rs file to see the full error taxonomy. The task involves reimplementing these error models in Pydantic within Subgrounds, then integrating error packaging into client methods and PaginationStrategy. A newcomer would need to understand the project's GraphQL client architecture and error handling patterns.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- graphql, python
- Lĩnh vực
- api, backend
- Loại issue
- Tính năng
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 45/100