How to get GraphQL error objects using GraphQLView in 2.0.0?
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 30/100
Hướng nghiên cứu
Kiểm tra việc tái cấu trúc GraphQLView trong phiên bản 2.0.0, đặc biệt là dispatch_request, và so sánh với đường dẫn execute_graphql_request trước đây được mô tả trong issue. Xác định liệu view đã được tái cấu trúc có thể cung cấp các đối tượng lỗi ban đầu và stack trace cho việc báo cáo bằng Raygun hay không; được xem là hoàn tất khi các lỗi vẫn còn khả dụng trước khi tuần tự hóa JSON.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Hello,
We are using this library to add graphql support to our flask app. We used to have version 1.3.1 installed and the following view code was working correctly:
class AppGraphQLView(GraphQLView):
def execute_graphql_request(self, *args, **kwargs):
"""Extract any exceptions and send them to Raygun"""
result = super().execute_graphql_request(*args, **kwargs)
if result is not None and result.errors:
send_errors_to_raygun(result.errors)
return result
We've recently updated to version 2.0.0 of this library, and this caused our errors to not be sent to raygun, because our function is no longer called.. I discovered that the whole of GraphQLView has been refactored to not include execute_graphql_request anymore so I tried using dispatch_request instead.
However, dispatch_request returns a json object and any errors have only the message, no stacktrace or any other important information we would need to send to raygun.
I have tried to replicate this functionality without overwriting GraphQLView's implementation of execute_graphql_request, by using middleware instead:
def error_reporting_middleware(next, root, info, **kwargs):
result = next(root, info, **kwargs)
if result.is_rejected:
send_errors_to_raygun([result.reason])
return result
This kinda works, but I was wondering if there is a similar way to do it using the refactored GraphQLView in v2.0.0.
Thanks!
- Ngôn ngữ chính
- Python
- Star
- 1.3k
- Fork
- 139
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
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
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của graphql-python/flask-graphql
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
graphql-python/flask-graphql#92 · 2 bình luận ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
-
which graphiql version is using? Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 35/100
graphql-python/flask-graphql#85 · 2 bình luận · 1 reaction ·
-
CSRF Exemption? Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 25/100
graphql-python/flask-graphql#84 · 1 bình luận ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
graphql-python/flask-graphql#80 · 9 bình luận · 2 reaction ·
Tất cả issue của graphql-python/flask-graphql
Issue tương tự
-
essnmx good first issue
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 95/100
-
[Feature] 奇物选择添加优先级 Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
syfoud/Simulated_Scepter#174 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Giskard-AI/giskard-oss#2840 · 1 bình luận ·
-
A claim comment carrying the issue number is silently declined while the workflow reports success Đang mởarea: repo bug perceived difficulty: 2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
yeti-platform/yeti#1380 ·