-
-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow to add graphql-request request/response middleware #322
Comments
Similar use-case: I can do it in every call, but it will be better to handle it centrally. For this I would like to attach client-wide callback which can see all responses and optionally throw exception (event if http status is 200) and debug message. |
@Diizzayy |
Your use case
To do things like generic error handling (using the http response object) we would need to add a custom graphql-request middleware. The only way we found to add this middleware is something like:
The solution you'd like
Provide a better way to define graphql-request options
Possible alternatives
Add the original response object to the onError composable, so we can access the http status code or other raw informations.
Additional information
No response
The text was updated successfully, but these errors were encountered: