# Send query variable value as an array or enum

**URL:** <https://discuss.dgraph.io/t/send-query-variable-value-as-an-array-or-enum/4000>\
**Category:** Dgraph\
**Created:** [February 6, 2019, 10:29am UTC](https://discuss.dgraph.io/t/send-query-variable-value-as-an-array-or-enum/4000 "2019-02-06T10:29:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ranic](https://avatars.discourse-cdn.com/v4/letter/r/4da419/32.png) [@ranic](https://discuss.dgraph.io/u/ranic)\
**Post date:** [February 6, 2019, 10:29am UTC](https://discuss.dgraph.io/t/send-query-variable-value-as-an-array-or-enum/4000/1 "2019-02-06T10:29:59Z")

</div>

Hi,

I need to be able to filter on an arbitrary number of values for a given predicate (which can be either string type or [string]). However currently, I don’t see an option apart from defining a separate query depending on the number of arguments, which is silly.

I saw a similar request this time last year (query variable value as array), any improvements?

Thanks! 🙏

---

<div class="post-metadata">

**Author:** ![MichelDiz](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/micheldiz/32/11873_2.png) [@MichelDiz](https://discuss.dgraph.io/u/MichelDiz)\
**Post date:** [February 6, 2019, 1:19pm UTC](https://discuss.dgraph.io/t/send-query-variable-value-as-an-array-or-enum/4000/2 "2019-02-06T13:19:59Z")

</div>

> [@ranic](#):
>
> query variable value as array

Did you mean “GraphQL variables”? (which are DQL Variables in fact)  
If so, there’s a small update about it

> <https://github.com/dgraph-io/dgraph/issues/2272#issuecomment-460850269>
>
> If you suspect this could be a bug, follow the template.
> 
> \- What version of Dgra…ph are you using?
> 
> 1.0.4
> 
> \- Steps to reproduce the issue (command/config used to run Dgraph).
> 
> \`\`\`
> query all($a: string, $b: string) {
> all(func: eq(whatever, \[$a, $b\])) {
> uid,
> }
> }
> \`\`\`
> 
> \> Expected comma or language but got: a
> 
> \- Expected behaviour and actual result.
> 
> Either I'm doing something wrong or GraphQL variables that are used in arrays don't work. And since it's not possible to define variable as arrays, it also seems impossible to do something like:
> 
> \`\`\`
> query all($a: \[string\]) {
> all(func: eq(whatever, $a)) {
> uid,
> }
> }
> \`\`\`

If not, can you be more specific?

Cheers.

---

<div class="post-metadata">

**Author:** ![nunucheong](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/nunucheong/32/8301_2.png) [@nunucheong](https://discuss.dgraph.io/u/nunucheong)\
**Post date:** [May 28, 2021, 2:52am UTC](https://discuss.dgraph.io/t/send-query-variable-value-as-an-array-or-enum/4000/3 "2021-05-28T02:52:59Z")

</div>

I think @ranic was referring to this: [Support lists in query variables (Dgraph's GraphQL Variable) · Issue #2726 · dgraph-io/dgraph · GitHub](https://github.com/dgraph-io/dgraph/issues/2726)

The request is well captured in [this reply](https://github.com/dgraph-io/dgraph/issues/2726#issuecomment-518910909).

Keen to know if there’s any improvement in this regard.
