How to pass a list of values in the http Request?

i tried hitting the Dgraph http endpoint to query my results, how do i pass a list of values through payload?

{
  "query": "query test($title: string,$statuses: string) { app as Applications(func:type(Application_PHENA0059)) @cascade{\n count(uid) HAS_HIRING_STATUS_ACTIVITY@filter(eq(currentStatus, [$statuses]))  {\n }\n }\n resultApp as Applicants(func:uid(app))@cascade{\n Applicants:  count(uid)\n FOR_JOB{\n WITH_TITLE @filter(eq(name,$title)){\n }\n }\n }\n Candidates(func:uid(resultApp))@cascade {\n ~HAS_APPLICATION{\n can as userId\n }\n }\n countSkills(func:uid(can))@groupby(HAS_SKILL) {\n skill as  count(uid)\n }\n mostCommonSkills(func:uid(skill),orderdesc: val(skill)){\n skill: name\n count :val(skill)\n }}",
  "variables": { "$title": "Product Engineering Manager", "$statuses":"Applicant" }
}

my payLoad looks like this, i want to send ,list of status instead of string
how can i acheive that?

Just send it as an array:

{
"query": ...
"variables": " { 
  ...., "$statuses:": ["Applicant", "Accepted', "whatever else"]
}

J

i tried that way but i am getting this error
` “errors”: [
{
“message”: “Error parsing JSON at line 3, character 76: json: cannot unmarshal array into Go struct field .variables of type string\n”,
“extensions”: {
“code”: “ErrorInvalidRequest”
}
}
]``

Is this graphql or a dql endpoint? Are you using fetch or apollo or urql?

https://dgraph.io/docs/graphql/api/requests/

Make sure to structure the query with JSON.stringify() depending on your code.

J