graphql-python / graphql-python/graphene
call super() from resolve_<field_name> to get default resolver
- 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ả
Here is the problem, I need to create a custom resolve method but the path
for the logic to might not always require the logic added in the custom resolve method thus
I would like to use the default resolver for the field.
But I am frustrated, in the MRO hierarchy there would be no class with that exact resolve name
because the resolve method is created computationally with a call to type() in some Meta or _meta* method
like it is done in https://github.com/graphql-python/graphene-django/
Ideally I could call super().resolve(info, **args) and graphene would know how to resolve the function call
I have no idea how else to call the auto generated resolver in graphene_django, unless it would be the same name as the resolver function from which im calling super which I guess makes sense, but I believe this to be
a graphene error because the ModelObjectType inherits from ObjectType.
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 bằng cách lần theo đường dẫn resolver được tạo trong graphene_django, bao gồm việc xây dựng type() và kế thừa ObjectType/ModelObjectType được đề cập trong issue. Xác định cách một resolve_ tùy chỉnh có thể truy cập default resolver, và định nghĩa việc hoàn thành là có một cách được tài liệu hóa, hoạt động được để gọi hành vi mặc định đó mà không sao chép nó.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- python
- Lĩnh vực
- api, backend-api-design
- Loại issue
- Tính năng
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- 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
- 35/100