Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

strapi-v5-plugin-populate-deep-field-fix

Package Overview
Dependencies
Maintainers
0
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

strapi-v5-plugin-populate-deep-field-fix

Strapi v5 plugin that populates nested content.

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
0
Weekly downloads
 
Created
Source

Strapi v5 Plugin: populate-deep

This plugin is a fork of the original strapi-plugin-populate-deep, which does not support Strapi v5 at the time of this publication.

Why this Fork?

With Strapi v5, a new API structure validation feature was introduced, which makes the populate parameter incompatible with how the original plugin works. This plugin addresses that by introducing a new parameter pLevel to avoid validation issues.

Installation

npm install strapi-v5-plugin-populate-deep

yarn add strapi-v5-plugin-populate-deep

Usages

The plugin allows you to deeply populate data in your Strapi queries with a new parameter pLevel. This parameter specifies the depth of population for your API responses.

Examples

  1. Populate a request with the default max depth. /api/articles?pLevel

  2. Populate a request with the a custom depth /api/articles?pLevel=10

Good to know

  • The default maximum depth is 5 levels deep.
  • The pLevel parameter works for all collections and single types when using findOne and findMany methods.
  • Increasing the depth level may result in longer API response times.

Configuration

You can configure the default depth globally through the plugin configuration.

Example configuration

To customize the default depth, add or modify the config/plugins.js file as shown below: config/plugins.js

module.exports = ({ env }) => ({
  'strapi-v5-plugin-populate-deep': {
    config: {
      defaultDepth: 3, // Default is 5
    }
  },
});

This configuration will set the default depth to 3 levels across all API requests unless specified otherwise in the request itself.

Contributions

This is a fork of NEDDL, that fixes an issue with the fields being populated incorrectly when they have colliding names and was raised in this PR.

This plugin is a fork of the original work by Barelydead and can be found in the original repository.

The original idea for getting the populate structure was created by tomnovotny7 and can be found in this github thread

We appreciate and acknowledge all contributions made by the open-source community to the original project.

FAQs

Package last updated on 14 Oct 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc