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

244
Visualizações
Expected Name, found ! Graphql when passing dynamic where through variables

I am new to Graphql, for a query I need to apply filters. as I followed up with this issue https://github.com/hasura/graphql-engine/issues/2355, I decided to pass the where clause itself dynamically as a variable. But am getting

Expected Name, found 

Here is my code

const where = {
 ...(condition1 ? {created_at: { created_at: { _in: this.startDate } }  } : {}),
  ...(condition2 ? {payment: { source: { _in: this.selectedStore } }  } : {}),
}

const { data } = await this.$apollo.query({
  query: orders_by_storeid_and_creation_time,
  variables: {
    where
  },
  fetchPolicy: "no-cache"
});

this is .gql

interface orders_filter_type{
  created_at:! any;
  payment:!any
 }

 query orders_by_storeid_and_creation_time(
   $where:orders_filter_type
   //tried $where:[orders_filter_type] 
   //tried $where:any 
 ) {
 orders(
  where:where
 ) {
   ...someFragment
  }
}

I am trying to implement in a way that, if the filter is not applied it shouldn't even let the graphql where clause to reach that condition.

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