This is with reference to the issue https://github.com/dgraph-io/dgraphgoclient/issues/5
Now that I understand better how the lexing/parsing is done, I have more idea about this.
- When q is a raw string literal with
\n
q := `mutation { set {<alice> <follows> <bob> . \n <alice> <name> "Alice" . \n <bob> <name> "Bob" . }}`
doesn’t work because if q is a raw string literal \n
isn’t interpreted, so only the first mutation is applied.
- When q is a raw string literal with explicit new line.
q := `mutation { set {<alice> <follows> <bob> .
<alice> <name> "Alice" .
<bob> <name> "Bob" . }}`
This would work when we give new lines explicitly.
- When q is an interpreted string literal with
\n
q := "mutation { set {<alice> <follows> <bob> . \n <alice> <name> \"Alice\" . \n <bob> <name> \"Bob\" . }}"
Works but object values have to be escaped as "
has to be escaped.
So there isn’t a bug here actually. Am I missing something here @mrjn?