mirror of
				https://github.com/strapi/strapi.git
				synced 2025-10-30 17:37:26 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			15 lines
		
	
	
		
			503 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			15 lines
		
	
	
		
			503 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
| 'use strict';
 | |
| 
 | |
| module.exports = ({ strapi }) => ({
 | |
|   buildComponentResolver({ contentTypeUID, attributeName }) {
 | |
|     const { transformArgs } = strapi.plugin('graphql').service('builders').utils;
 | |
| 
 | |
|     return async (parent, args = {}) => {
 | |
|       const contentType = strapi.contentTypes[contentTypeUID];
 | |
|       const transformedArgs = transformArgs(args, { contentType, usePagination: true });
 | |
| 
 | |
|       return strapi.entityService.load(contentTypeUID, parent, attributeName, transformedArgs);
 | |
|     };
 | |
|   },
 | |
| });
 | 
