Request (React-Query x Axios): Option to make Auto-generated Queries Pass Metadata into Axios Request Config #966
ThomasAitken
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Context:
We have set up an Axios interceptor for handling failed requests and sending errors to Sentry manually. When this happens, we want to generate an error fingerprint in order to group the same errors on a given endpoint. But there is no metadata in the Axios request to tell us what API endpoint was invoked. We have the specific url of course, but we don't know what operation/endpoint pattern it corresponds to (without a hacky, failure-prone regex solution). So we would prefer if the operation name and the url pattern were passed into the Axios config initially, so we could retrieve them at that point.
Consider this auto-generated function:
With relevant Orval options enabled, it would change to something along the following lines:
Perhaps this is possible using Orval as it exists currently but I couldn't determine how to do it from the docs.
Also I am not sure what the interface should be for this change but if you could figure something out, that would be very helpful!
Beta Was this translation helpful? Give feedback.
All reactions