-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed as not planned
Labels
Stalearea/querylangIssues related to the query language specification and implementation.Issues related to the query language specification and implementation.area/querylang/varsIssues related to queries with GraphQL variablesIssues related to queries with GraphQL variableskind/featureSomething completely new we should consider.Something completely new we should consider.popularpriority/P2Somehow important but would not block a release.Somehow important but would not block a release.status/acceptedWe accept to investigate/work on it.We accept to investigate/work on it.
Description
Experience Report
I often have queries where I want to match a list of things (similar to an IN query in SQL). For example:
{
someQuery(func: eq(somePredicate, val1, val2){
someField
}
}
Often, these values come from user input and I want to pass these values to the query using query variables.
Effectively, this would allow a query like so:
query($vals: []string){
someQuery(func: eq(somePredicate, $vals){
someField
}
}
What you wanted to do
I wanted to pass a list of values as a query variable into a query.
What you actually did
I had to create the query programmatically using string concatenation.
Why that wasn't great, with examples
Having to use string concatenation introduced a lot of noise into the code and the query was very unreadable.
Any external references to support your case
None.
d4l3k, phosae, Sceat, sjhewitt, dpkirchner and 7 more
Metadata
Metadata
Assignees
Labels
Stalearea/querylangIssues related to the query language specification and implementation.Issues related to the query language specification and implementation.area/querylang/varsIssues related to queries with GraphQL variablesIssues related to queries with GraphQL variableskind/featureSomething completely new we should consider.Something completely new we should consider.popularpriority/P2Somehow important but would not block a release.Somehow important but would not block a release.status/acceptedWe accept to investigate/work on it.We accept to investigate/work on it.