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

149
Visualizações
Gatsby group doesn't work in GraphQL with custom nested types

I have the following types defined in Gatsby:

type Track implements Node {
  title: String!
  chapters: [Chapter] @link
}

type Chapter implements Node {
  title: String!
  videos: [Video] @link
}

type Video implements Node {
  title: String!
}

This is all set up and working nicely when I query data like this:

query {
  allTrack {
    chapters {
      videos {
        title
      }
    }
  }
}

However, when I try to use the group keyword in GraphQL, it returns a really weird response:

query {
  allTrack {
    group(field: chapters___videos___title) {
      fieldValue
      totalCount
    }
  }
}

// RESPONSE
{
  "data": {
    "allTrack": {
      "group": [
        {
          "fieldValue": "Title 1,Title 2",
          "totalCount": 5
        }
      ]
    }
  }
}

In other words, it seems to be adding all the titles together instead of counting them separately. If I just count the track titles, everything works perfectly.

Can anyone help with this?

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