mirror of
https://github.com/strapi/strapi.git
synced 2025-12-03 02:23:44 +00:00
Use getModel instead of contentTypes[] to handle both content types & components in components resolvers
This commit is contained in:
parent
1a7f02a19d
commit
4a2f331120
@ -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);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user