-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
queryFn doesn't update on error, and continues on pending state #4620
Comments
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
i updated the issue @EskiMojo14 thank you for taking my mistake with a lil of humor hahahaha |
hmm, i don't see anything obvious - have you added some console logs to work out which |
Yea, i even tried to return the error even before executing the query, like :(
|
One finding, on the useEffect i execute the validateDatablob, i have this logic
If i console log the result when i return an error, it has the error, but idk why the other out of the box states from RTK are not updating |
do you have any other reducers that are listening for the rejected action (validateDataBlob.matchRejected) that might be throwing errors? |
Closing due to lack of additional info. |
Hello!, i'm implementing an api with a single mutation using queryFn
From the docs I understand that, the queryFn is expected to return an object with the following pattern
{ error: {...} }
, but for some reason, when i return an error, the mutation doesn't finish and continues onpending
statethis is the code (i'll remove the non-essentials)
and for clarification, the success path works as expected, if i return
{ data: whatever }
the mutation finalize as expectedthis is how im using the mutation
and calling validateDataBlob inside a useEffect that has other logic, the versions i have are:
The text was updated successfully, but these errors were encountered: