Use variable in eq function

with this query return nothing,

{
  me as var(func: eq(user_id, "DA0000000004")) {
    school as university_name
    fr as friend {
    }
  }
  findfriends(func: eq(university_name, val(school)), first: 10)  @filter(not uid(me, fr)) {
    _uid_
    user_id
    user_code
    uname
    real_name
    university_name
  }
}

this is perfect, can variable used in eq function?

{
  me as var(func: eq(user_id, "DA0000000004")) {
    fr as friend {
    }
  }
  findfriends(func: eq(university_name, "University name of  DA0000000004"), first: 10)  @filter(not uid(me, fr)) {
    _uid_
    user_id
    user_code
    uname
    real_name
    university_name
  }
}

@yupengfei There is limited support for variables in functions. The following is supported.

gt(val(total), 100)```

Use of variables in second argument is not yet supported. So the following won't work.
```eq(school, val(myschool))
gt(numFriends, val(fcount))```

I have filed an issue for the same.

@yupengfei: The support for value variables in functions is in master now.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.