-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Description
I am using the responseSchema option to validate server responses. When the received data does not match the schema, useQuery returns an error state (isError: true).
I would like to achieve the following behavior:
If the HTTP request succeeds, useQuery should return the raw response data even when it does not match the schema, while schema validation errors can be handled via onSchemaFailure (for example, for logging purposes).
Is there a way to disable this behavior using a configuration flag in createApi or some other global option? I could not find any information about this in the documentation.
I am aware of the transformResponse approach with manual schema.parse / schema.safeParse, but this requires duplicating the same logic in every endpoint, which I would like to avoid.