Open Krispy2009 opened 5 years ago
+1 with this. As of v2, we no longer have the ability to extend / wrap the graphql query execution.
Middelwares alone are not sufficient to workaround this because they don't provide a hook around the whole request. For example, you can't measure the execution time of a request using a middleware (see graphene-tornado
extensions for more example). Ideally this hook would be at the Graphene layer but since GraphQLView
takes a middleware, I think it makes to provide a simple hook around execute
.
I'm happy to send PR in the next few months if there is interest.
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:
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 usingdispatch_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: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!