Jean-Sébastien Herbaux 37311b2757
[V4] GQL - Handle empty dynamic zone (#10926)
* Add an Error object type

* Fix typo in collection-type queries definition

* Add dynamic zone resolver

* Handle empty dynamic zone (no component attached)
2021-09-09 16:45:38 +02:00

8 lines
225 B
JavaScript

'use strict';
module.exports = ({ strapi }) => ({
buildDynamicZoneResolver: ({ contentTypeUID, attributeName }) => async parent => {
return strapi.db.entityManager.load(contentTypeUID, parent, attributeName);
},
});