Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

222
Vistas
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 la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda