Skip to content

Query variable for query block not recognised after upgrading to 1.1.0 #4038

@akamos

Description

@akamos

What version of Dgraph are you using?

1.1.0 and master

Have you tried reproducing the issue with the latest release?

Yes.

What is the hardware spec (RAM, OS)?

MacBook Pro 15, Mac OS Mojave

Steps to reproduce the issue (command/config used to run Dgraph).

Load the schema and data from tutorial in a clean database (http://tour.dgraph.io/intro/3/ and http://tour.dgraph.io/intro/3/) and execute following query:

{
  count as personCount(func:type(Person)) {
    total: count(uid)
  }
  
  allPerson(func:uid(count)) @filter(eq(name, "Michael")) {
    name
  }
  
}

Produces following error:

Error Name: t

Message: Some variables are used but not defined
Defined:[]
Used:[count]

In comparison following query works fine.

{
  count as personCount(func:type(Person)) {
  
  }
  
  personCount2(func:uid(count)) {
    total: count(uid)
  }
  
  pagedPersons(func:uid(count)) @filter(eq(name, "Michael")) {
    name
  }
  
}

and produces that result:

{
  "data": {
    "personCount": [],
    "personCount2": [
      {
        "total": 8
      }
    ],
    "pagedPersons": [
      {
        "name": "Michael"
      }
    ]
  },
  "extensions": {
    "server_latency": {
      "parsing_ns": 103800,
      "processing_ns": 6377400,
      "encoding_ns": 42900,
      "assign_timestamp_ns": 2070700
    },
    "txn": {
      "start_ts": 12
    }
  }
}


URL: http://localhost:8080/query?timeout=60s

Expected behaviour and actual result.

The variable should be recognised and the query successfully executed. In Version 1.0.16 this still worked.

Metadata

Metadata

Assignees

Labels

area/querylangIssues related to the query language specification and implementation.kind/bugSomething is broken.priority/P0Critical issue that requires immediate attention.status/acceptedWe accept to investigate/work on it.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions