Skip to content

Add support of Value Variables for uid_in. #3066

@MichelDiz

Description

@MichelDiz

Experience Report

What you wanted to do

{

  getJeunet as var(func: eq(name@fr, "Jean-Pierre Jeunet")) 

  caro(func: eq(name@en, "Marc Caro")) {
    name@en
    director.film @filter(uid_in(~director.film, val(getJeunet) )) {
      name@en
    }
  }
}

If I use @filter(uid_in(~director.film, val(getJeunet))) it gets the error ": Wrong variable type encountered for var(getJeunet) 2.". I've tried other ways too just to test.

This could avoid problems with UID changes in Nodes. And be used in documentation.

Why that wasn't great, with examples

Most functions accept Query Variables

BTW

uid_in works fine with DQL Variables.

Some discussion on this https://discuss.dgraph.io/t/uid-in-cant-use-variables/2772
https://discuss.dgraph.io/t/improve-uid-in-with-value-variable/5266

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/querylangIssues related to the query language specification and implementation.area/querylang/varsIssues related to queries with GraphQL variableskind/enhancementSomething could be better.priority/P1Serious issue that requires eventual attention (can wait a bit)status/acceptedWe accept to investigate/work on it.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions