Open amaster507 opened 2 months ago
There is a question what to do though if the query actually wants to find a string that is equal to what could be evaulated as an array. That is something that will need to be tested and allow a workaround. I know I used strings to store JSON values in Dgraph, and I am sure others do. What I am not sure though is if anyone is querying with eq
on those strings. Maybe the better option would be to add the $srcIds: [string]
to not break existing functionality of searching for json like strings with $srcIds: string
Use case and current behavior
This list syntax only works with uids. I don't even know why the example
["13", "14"]
is in the docs because those are not hexidecimal uids, and it just adds confusion thinking this feature is already implemented.I can do:
But I can't do:
Alternatively, when I want to query for a list of items not a uid, I have to dynamically build a more complex query and variable list.
Enhancement
It would be nicer to do this:
Solution proposal
No response
Links to Discuss, RFC or previous Issues and PRs
https://discuss.dgraph.io/t/how-to-find-nodes-given-an-array-of-values/3316/7?u=amaster507
Links to examples and research
https://dgraph.io/docs/query-language/graphql-variables/
Additional Information
It would be best to support the syntax
$srcIds: [string]
but for now a quicker fix would just allow an array of strings/ints like the$uids: string
accepts.