Populate All
A lightweight plugin to recursively populate nested data in RESTful API requests
Strapi Plugin Populate All
A lightweight Strapi plugin that enables you to recursively populate all nested components, dynamic zones and relations in your REST API responses using a simple query parameter: ?populate=all
.
Features
- Use
?populate=all
in your API requests to automatically and deeply populate all nested relations, components, and dynamic zones for any content type. - Fine-tune which relations are populated using plugin configuration.
- The generated populate queries are cached, so repeated REST requests for the same model are faster.
Installation
All you need to do is install the plugin. Strapi should automatically detect and include it.
1npm install strapi-plugin-populate-all
Usage
Just add ?populate=all
to your REST API request, for example: GET /api/articles?populate=all
This will return the article with all nested components, dynamic zones and relations fully populated, regardless of depth.
Configuration
You can configure which relations should be populated by default.
Add the following to your Strapi project's config/plugins.js
(or config/plugins.ts
):
1module.exports = {
2 'populate-all': {
3 enabled: true,
4 config: {
5 // Populate all relations recursively (default)
6 relations: true,
7
8 // OR: Do not populate any relations
9 relations: false,
10
11 // OR: Only populate specific collection types by UID
12 relations: ['api::article.article', 'api::category.category'],
13 },
14 },
15};
How it works
- The plugin provides a global middleware that intercepts requests with
?populate=all
and rewrites the query to trigger recursive population. - In the background, it builds a standard Strapi populate query as described in the Strapi documentation.
- You can control which relations are included using the relations config option.
- Inside the document API, you can set
populate: '*'
andrecursive: true
to make it work
Install now
npm install strapi-plugin-populate-all
Create your own plugin
Check out the available plugin resources that will help you to develop your plugin or provider and get it listed on the marketplace.