Escaping special characters


(Mikhail Fokanov) #1

Hello.

What characters should be escaped in Dgraph queries?
I guess the following list:

  1. \ character
  2. " character
  3. new line character
  4. carriage return character

Is there anything else?

P.S. I make requests by java Dgraph client.


(Daniel Mai) #2

There’s a blurb in the docs about escaping special characters: https://docs.dgraph.io/query-language#returning-values

Note: If your predicate has special characters, then you should wrap it with angular brackets while asking for it in the query. E.g. <first:name>

I’d include <, >, /, and : characters for escaping.