How to bind .query property onto strapi object

System Information
  • 3.4.1:
  • MacOS 11.0.1 (20B29):
  • sqlite:
  • 12.18.4:
  • 6.14.6:
  • 1.22.10:

Can’t bind .query property onto strapi object to make queries through custom service of a plugin.

You can do this inside the bootstrap function.

An example of how I bind a long query:

module.exports = async () => {

strapi.getConfigs = async function () {
       return strapi.query('my-custom-configs', 'my-custom-plugin-with-configs').findOne();

Now in all my project, I can call strapi.getConfigs()

Bootstrap.js documentation:

1 Like

Thanks for your involving. We have resolved the issue. It was some trouble in project as is.