How to use DQL in Dgraph Cloud Admin Interface?

Hi there!

I was curious and did try the Tab DQL in the Dgraph Admin Interface. Unfortunately, I only get errors when doing so. Ho do you use this? I could only find examples when using it locally.

Cheers!

1 Like

RDF syntax is like this:

{
  set {
    # triples in here
  }
}

This syntax you are using is for JSON.

Cheers for the response. I did try that first but unfortunately it then says invalid JSON

So looks like this UI accepts only JSON? There is an embedded Ratel somewhere. Try that one. Or use the JSON syntax.

1 Like

Seems like the Ratel works :ok_hand:

But how would I write this thing in JSON?

{
  "set": {
      ????
   }
}

Here https://dgraph.io/docs/mutations/json-mutation-format/#json-syntax-using-raw-http-or-ratel-ui

Thanks! I’m obviously to dumb for this :see_no_evil: No clue how to write a triple in JSON. Doesn’t matter, I only need it if I want to manually update some fields with the @id directive. I just change the schema briefly, update and then change it back.

Cheers anyway!

That’s really simple

{
   "set": [
      {
         "uid": "0x7",
         "User.email": "email@me.com"
      }
   ]
}

The other details you can check the docs.

1 Like