Skip to content

Named queries without variables don't parse #3994

@campoy

Description

@campoy

What version of Dgraph are you using?

v1.1.0

Have you tried reproducing the issue with the latest release?

yes

What is the hardware spec (RAM, OS)?

playground

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

Running this query works:

query works($name: string = "Francesc") {
  q(func: has(name)) {
    name
  }
}

But if you realize that the query doesn't use the variable and you decide to remove it:

query works() {
  q(func: has(name)) {
    name
  }
}

You get the error:

Error Name: t

Message: line 1 column 12: Invalid comma in var block

URL: http://localhost:8080/query

Expected behaviour and actual result.

It should just parse it correctly

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/parsingIssues related to the parser or lexer.area/querylang/varsIssues related to queries with GraphQL variableskind/bugSomething is broken.priority/P2Somehow important but would not block a release.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