Lexing error in v2 API

Open
#265 10 comments 0 reactions 1 assignee View on GitHub

@matthewmcneely is already working on this.

Since Jun 24, 2025.

Assessment

This issue has not been assessed yet.

Description

Stale

Describe the bug

Hello, i'm in the process of moving to the v2 apis to make use of namespaces. In doing so I am getting lexing errors in queries that previously worked (and still succeed in ratel). I think the json parsing has differences.

To Reproduce

Take the following json from one of our test cases:
{"set":[{"uid":"_:R_1","dgraph.type":["Record","Agg1Record"],"Record.type":"agg1","Record.updateTS":"2025-06-24T08:59:24.894369149Z","Record.identifier":"agg1:BASIC1","Record.dateTime":"2017-02-20T12:00:00Z","Record.raw":"{\"doc\":\"Aggregation Document 1\"}","Record.hash":"3bpk0kclixpif","Record.individualEntity":[{"uid":"_:E_1_1","dgraph.type":["Entity","IndividualEntity"],"IndividualEntity.updateTS":"2025-06-24T08:59:24.894369149Z","IndividualEntity.identifier":"agg1:BASIC1:1","IndividualEntity.full":true,"IndividualEntity.displayName":"Aggregate 1 High","IndividualEntity.nameNormalised":"aggregate 1 high","IndividualEntity.customNameEmbedding":"22ejj75adgi22","IndividualEntity.nameParsed":"{\"initials\":[\"a\",\"h\"],\"raw\":\"aggregate 1 high\",\"words\":[\"aggregate\",\"1\",\"high\"]}","IndividualEntity.graphEmbedding":"te1kunpmfqr8","IndividualEntity.name":"Aggregate 1 High","IndividualEntity.individualID":1}]}]}

In Ratel I get Message: Done

When passing the same string to ns.Client.RunDQL(ctx, ns.Name, mutation) I get:
at line 1 column 1: Unexpected character while lexing DQL: U+0022 '\"'"

Expected behavior

The structure of a set request matched in ratel and v2 api

Environment

  • OS: amazonlinux
  • Language Go
  • Version latest master
Dominant language
Go
Stars
390
Forks
88
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from dgraph-io/dgo

All issues in dgraph-io/dgo

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.