if you use it this way it will return an error. For Dgraph does not recognize this “bad-uid” line as something intelligible to the required function (uid). So Dgraph will assume it’s a variable. and return the error: Some variables are used but not defined Defined:[] Used:[bad-uid]Preformatted textid]
There is no way to cause UID query function error, return null or empty. You will always get some response. The only way to get an empty answer is by doing an indexed search or by kinds.
Yes
Create positive Kinds for this (or some indexing). For example, you need to know if your Dgraph has a specific Node type. Whether it exists or not. Through Kind you can get this answer.