Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

223
Visualizações
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
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda