Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

221
Views
Graphql conditional where Query

I am Using Graphql to fetch data from api with some Where condition. In that, i need to check whether a field is not null and if so then i need to check for some key is present in that object and write the where query.

My Graphql query is as follows:

query Orders{
  orders(limit:500 where:"(store(key in (\"store1\",\"store2\"))) and (state(key in (\"state1\",\"state2\")))"){
      total
      count
      results {
        id
        origin
        store{
          key
        }
        state{
          key 
          id
        }
      }
  }
}

if i run the above query i am getting error as below

"message": "Malformed parameter: where: The field 'key' does not exist.",
      "path": [
        "orders"
      ],

This is because the object state is null in some of the results and so , i need to check for the key if the state object is not null.

I tried state!=null but this doesn't work. Any ideas or suggestions?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!