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

142
Views
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
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!