I’ve been trying to modify an entry using a mutation where the field I am trying to update is the UID field. I’m currently working with the dgraphjs with grpc. The current structure I have is this:
where relationID is something like 0xc1. I keep getting the following error being thrown. I’m not entirely sure what is needed here to fix this. It looks to me like dgraphjs needs a specific type of data for this fiend, which, in the schema is defined as [uid] type. What is the correct way to parse a UID here? The weird part is that the entryID does not throw this error.
Not sure what is happening to your case. The UID field can be just a string. There’s no especial type in JavaScript for uint64.
So you are trying to update the child of “entryID”. Which looks like a question → answer relation. You said that the type is one to many ([uid]). If you are adding a new relation your mutation should look like this:
Thanks for taking a look at this. I realized what the issue here is. I was constructing the request improperly, it has nothing to do with types (well, not really). I ended up scanning through the example and inferring that I needed to design the mutation a little differently. I put together this as my updated request:
Got it. That’s a common mistake. So, you’re new to Dgraph. Be welcome!
This error comes from Dgraph itself. Not sure if it is clear to users, but don’t confuse those errors with the language you are running. This error is trying to say to you that the key you are inserting isn’t a string in Dgraph. But a Scalar UID. Maybe we should improve these logs.
The log logic is like: “What it is on DB and What it got from you”.