-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
update_*_by_pk mutation with empty body should still return the target row #6061
Comments
Not having a |
I haven't looked into the Hasura internals, so I apologize if I'm making a fool out of myself -
|
It's basically using the
I guess it could do it but it would be against the semantics of update which only returns updated rows.
I do not agree that this is counter-intuitive. Since there is nothing to update, hence nothing to return. In fact, it is worth looking into throwing a validation error for an empty If you need a workaround, then you can set the primary key again:
|
I didn't expect "update" to include no-ops, but if Postgres is saying that a no-op counts, then I guess a no-op counts! Thank you for your time. I'll use that work-around. |
Consider the following GraphQL mutation:
Today, this returns
update_user_by_pk: {}
instead ofupdate_user_by_pk: { username: "lilred" }
.This is problematic for my use case. I have a choice of several plug-ins that I can dispatch some request to, and they return a field to put in
_set
forupdate_user_by_pk
. One of my plug-ins returns the empty object, but this breaks calling code because now when I submit the subsequent mutation I'm not getting the username back.The text was updated successfully, but these errors were encountered: