Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RegExp Variable Replacement Not Working on Filters #3268

Closed
vcshih opened this issue Apr 8, 2019 · 0 comments · Fixed by #4230
Closed

RegExp Variable Replacement Not Working on Filters #3268

vcshih opened this issue Apr 8, 2019 · 0 comments · Fixed by #4230
Assignees
Labels
area/querylang/filter Related to the filter directive. area/querylang/vars Issues related to queries with GraphQL variables kind/bug Something is broken. kind/enhancement Something could be better. priority/P1 Serious issue that requires eventual attention (can wait a bit) status/accepted We accept to investigate/work on it.
Milestone

Comments

@vcshih
Copy link

vcshih commented Apr 8, 2019

I am working using version 1.0.11 of dgraph and interacting with the graph using the Ratel interface.

I have a query that I have constructed as:

 query all($regexp_query: string = "/(?i)sal/" ) {
  objects (func: has(_predicate_))
  @filter( regexp(name, $regexp_query) )
  {
		uid
  }
}

with the intention of filtering using regular expression. This doesn't work, and it gives an error message of ": Function 'regexp' requires 2 arguments, but got 1 ([/(?i)sal/])"

however:

query all($regexp_query: string = "/(?i)sal/" ) {
  objects (func: regexp(name, $regexp_query))
  {
		uid
  }
}

Does work.

I noticed that this is similar to the issue raised in Issue #2333. Can this fix also be applied to the filter function on a query?

@srfrog srfrog added the kind/enhancement Something could be better. label Apr 8, 2019
@campoy campoy added area/querylang/vars Issues related to queries with GraphQL variables kind/bug Something is broken. priority/P1 Serious issue that requires eventual attention (can wait a bit) status/accepted We accept to investigate/work on it. labels Sep 13, 2019
@campoy campoy added this to the Dgraph v1.1.1 milestone Sep 13, 2019
@campoy campoy added the area/querylang/filter Related to the filter directive. label Sep 13, 2019
@harshil-goel harshil-goel self-assigned this Oct 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/querylang/filter Related to the filter directive. area/querylang/vars Issues related to queries with GraphQL variables kind/bug Something is broken. kind/enhancement Something could be better. priority/P1 Serious issue that requires eventual attention (can wait a bit) status/accepted We accept to investigate/work on it.
Development

Successfully merging a pull request may close this issue.

4 participants