Use getModel instead of contentTypes[] to handle both content types & components in components resolvers

This commit is contained in:
Convly 2021-11-18 16:20:08 +01:00
parent 1a7f02a19d
commit 4a2f331120

View File

@ -5,7 +5,7 @@ module.exports = ({ strapi }) => ({
const { transformArgs } = strapi.plugin('graphql').service('builders').utils;
return async (parent, args = {}) => {
const contentType = strapi.contentTypes[contentTypeUID];
const contentType = strapi.getModel(contentTypeUID);
const { component: componentName } = contentType.attributes[attributeName];
const component = strapi.getModel(componentName);