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

updateById: expects record but I want to update one field

Open nsursock opened this issue 5 years ago • 1 comments

Hello, I followed a tutorial and now I can use GraphQL. it was pretty straightforward but I'm having troubles updating a record in my db. Here is my query: I just want to update the album on the recordId mentioned. I don't get it. can somebody help me?

what if I want to update 2 fields (say track number and album) instead of one field?

`mutation { songUpdateById(_id: "5ffaef4fdcf92f89fd19a816", record: { album: "Ready 2 Go" } ) { _id, title, artist, album

} }`

nsursock avatar Jan 12 '21 08:01 nsursock

Hello @nsursock , is it still an issue? if yes, could you share your schema? AFAIK, it should be able to list all fields that needs to be updated (only at top one level, not nested ones), unprovided fields in record won't be updated/overwritten.

Resousse avatar Jun 01 '22 07:06 Resousse