-
Notifications
You must be signed in to change notification settings - Fork 109
Promise callback of Mutate function not being called #121
Comments
Hey @ajhenry! Thanks for reporting this! It’s almost midnight in Germany. We will for sure look at this in the morning. Appreciate your using our tools! |
Indeed the error is not correctly propagated in https://codesandbox.io/embed/competent-lalande-z3jsk?fontsize=14 Good catch for the example in the documentation 😅 using |
Published v7.6.2 under
|
@TejasQ Yes I can confirm that this PR fixed the issue with the error callback. One other thing I did notice is that when issuing a PUT verb, it is common to get back a 204 response code (No Content), but it seems the fetch response handler still tries to call This is more of a nitpick issue though, but thank you for the fix! |
Woah. Thanks for that! We'll fix that too! |
Time to add a new unit test! Thanks for the feedback 💯 |
Describe the bug
When using a
Mutate
function with the PUT verb, the callback of the mutation promise is not calledTo Reproduce
Minimal Code example to reproduce
There are no throw errors and loading turns from false -> true -> false indicating an operation took place.
Not sure if the operation is being aborted early for some reason, or is throwing an error that is not being caught by the Mutate function.
NOTE: You can use the
.finally
method on the promise but it is unclear if this is intended behavior in the docsExpected behavior
According to the docs, "Each mutation returns a promise...", which to me indicates that I should be allowed to use the
.then
function on the returned promise.Screenshots
N/A
Desktop (please complete the following information):
Additional Note
Even the docs are using the
.then
function on the mutate function so I believe this is definitely a bugSee here
Also a side note,
delete
is a reserved word in JS and that line will result in a compile errorThe text was updated successfully, but these errors were encountered: