graphql-engine icon indicating copy to clipboard operation
graphql-engine copied to clipboard

update_*_many returns wrong type when updates is empty

Open sproctor opened this issue 1 year ago • 0 comments

Version Information

Server Version: 2.36.3

Environment

OSS

What is the current behaviour?

query:

{"operationName":"updateUser","variables":"updateRoles":[]},"query":"mutation updateUser($updateRoles: [user_role_updates!]!) { update_user_role_many(updates: $updateRoles) { affected_rows } }"}

returns:

{"data":{"update_user_role_many":{"affected_rows":0}}}

I'm attempting to use this as part of a multipart mutation, hence running this mutation when there's nothing to do.

What is the expected behaviour?

The return should be a list.

{"data":{"update_user_role_many":[]}}

Any possible solutions/workarounds you're aware of?

Don't include update_*_many in the mutation when there is nothing for it to do.

sproctor avatar Feb 17 '24 16:02 sproctor