Reputation: 103
Is there a way to specify error response per endpoint? Like we can specify Result & Request type when defining a query or mutation. I did went through the documentation and updated the base query. I am getting the generic success/error response types but still trying to figure out how to define error type per endpoint.
Upvotes: 3
Views: 6937
Reputation: 193
My issue as well is that there is a type definition for {error} and they don't comply to my console.log(error). The following solution allowed me to define my own types for {error}
} else if (error) {
console.log(error);
const newError:CreateYourInterfaceBasedOnConsoleLog = error;
content = <p>{newError.status} = {newError.data.detail}</p>
} else {
Upvotes: 0
Reputation: 44226
As per our GitHub Discussion (which might be insightful for others with the same question): not at the moment.
Upvotes: 1