syarif
syarif4mo ago

updating nested object with optional id field

I have scheme like this
users:{
nib:v.object({
no:v.string(),
consultant_id:v.optional(v.id("users))
})
}
users:{
nib:v.object({
no:v.string(),
consultant_id:v.optional(v.id("users))
})
}
if I perform patch with the same value of nib.no but different value of nib.consultant_id, the nib.consultant_id is not updated in the database. only if the nib.no is different then the both nib.no and nib.consultant_id are updated any one know why? if this is limitation, how to better design my schema?
2 Replies
jamwt
jamwt4mo ago
@syarif can you paste the body of the actual mutation?
syarif
syarifOP4mo ago
pardon me, it's my mistake. I didn't see there is checking of nib.no on top of the mutation function. it will not go through if the nib.no is different.. thanks btw @jamwt

Did you find this page helpful?