How to use the strapi/lib/configuration/hooks/graphql/helpers/.getAssociationsByIdentity function in strapi

To help you get started, we’ve selected a few strapi examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github strapi / strapi / packages / strapi-hook-bookshelf / lib / utils / graphql.js View on Github external
fetchAll: (collectionIdentity, collection, criteria) => {
    const filters = _.omit(helpers.handleFilters(criteria), value => {
      return _.isUndefined(value) || _.isNumber(value) ? _.isNull(value) : _.isEmpty(value);
    });

    return collection.forge()
      .query(filters)
      .fetchAll({withRelated: helpers.getAssociationsByIdentity(collectionIdentity)})
      .then(data => data.toJSON() || data);
  },

strapi

An open source headless CMS solution to create and manage your own API. It provides a powerful dashboard and features to make your life easier. Databases supported: MongoDB, MySQL, MariaDB, PostgreSQL, SQLite

SEE LICENSE IN LICENSE
Latest version published 2 years ago

Package Health Score

41 / 100
Full package analysis