How to query component data in deeply nested relationships

System Information
  • Strapi Version: v3.3.3
  • Operating System: macOS Catalina v10.15.7
  • Database: MySQL v5.7
  • Node Version: v12.18.2
  • NPM Version: N/A
  • Yarn Version: N/A

Hey there,

I originally asked this on the Slack help channel but no-one was able to help so I thought I’d try my luck here. I was wondering if someone can shed some light on how to fetch component data on a deeply-nested relationships:

eg. We have a collection type Program that has a one-to-many relation to another collection Unit and that has a one-to-many relation to a collection called Lesson - the Lesson collection type is the lowest level we need, and it has a repeatable component field on it among other data, but I can’t seem to fetch it.

So when I use a query like:

{
   programs {
	 units {
       lessons {
         id
         activities {
           title
         }
       }
     }
   }
}

(where “activities” is the repeatable component) - it will return the lesson itself (see below), but won’t populate any of the content/components within it such as activities - I’ve tried many variations of a custom service population query but can’t seem to get it right.

{
  "data": {
    "programs": [
      {
        "units": [
          {
            "lessons": [
              {
                "id": "1",
                "activities": null
              },
              {
                "id": "2",
                "activities": null
              },
              {
                "id": "3",
                "activities": null
              }
            ]
          }.   
        ]
      }
    ]
  }
}

I read that Strapi has a limitation on how many levels deep it will resolve for performance reasons, but is there any way for me to populate the repeatable components/other content that exists on the lesson type using a custom query in the service, or would I need to do a secondary call of some kind? Thanks in advance :slightly_smiling_face:

Hey, did you find any solution? I’m struggling with this one “fetching deep filtering with component level”.