mirror of
				https://github.com/strapi/strapi.git
				synced 2025-10-31 09:56:44 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			27 lines
		
	
	
		
			813 B
		
	
	
	
		
			GraphQL
		
	
	
	
	
	
			
		
		
	
	
			27 lines
		
	
	
		
			813 B
		
	
	
	
		
			GraphQL
		
	
	
	
	
	
| module.exports = {
 | |
|   type: {
 | |
|     UsersPermissionsPermission: false // Make this type NOT queriable.
 | |
|   },
 | |
|   resolver: {
 | |
|     Query: {
 | |
|       role: {
 | |
|         resolverOf: 'UsersPermissions.getRole',
 | |
|         resolver: async (obj, options, ctx) => {
 | |
|           await strapi.plugins['users-permissions'].controllers.userspermissions.getRole(ctx);
 | |
| 
 | |
|           return ctx.body.role;
 | |
|         }
 | |
|       },
 | |
|       roles: {
 | |
|         description: `Retrieve all the existing roles. You can't apply filters on this query.`,
 | |
|         resolverOf: 'UsersPermissions.getRoles', // Apply the `getRoles` permissions on the resolver.
 | |
|         resolver: async (obj, options, ctx) => {
 | |
|           await strapi.plugins['users-permissions'].controllers.userspermissions.getRoles(ctx);
 | |
| 
 | |
|           return ctx.body.roles;
 | |
|         }
 | |
|       }
 | |
|     }
 | |
|   }
 | |
| };
 | 
