-
-
Notifications
You must be signed in to change notification settings - Fork 54
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
[BUG] If i dont read any prop of mutation result, mutation not calls #186
Comments
for sure it is 👍 |
Is there any workaround for this? |
if the return type is nullable you can simply do "mutationFoo?.__typename", and if the mutations return scalars this issue doesn't apply |
FYI: If you need to work around this but want to return the full result of the mutation you need to make sure to access at least one property, even if you do not need it. const [sendMessage] = useMutation((mutation) => {
const message = mutation.createMessage({ text: 'lol' })
if (message.__typename) {}
return message;
})
<button onClick={()=> sendMessage()}>Send</button> This issue also messes with |
this not call mutation
this call mutation
Solution:
if user not fire "get" caps of Proxy in mutation handler, you must assume that the value returned by the mutation is irrelevant to the user, but the mutation must be performed. What "mutation query" to generate based on this? Hmm, well, you have the whole scheme, find something related to the type ID, or, in extreme cases, the banal request "__typename"
P.S. By the way, if I do PR for the Issue place, is that welcome?
The text was updated successfully, but these errors were encountered: