mirror of
https://github.com/strapi/strapi.git
synced 2025-11-02 02:44:55 +00:00
Fixed issue where custom GraphQL Mutation resolvers never triggered policies
This commit is contained in:
parent
36e4e73ad3
commit
fd02d99b28
@ -23,7 +23,11 @@ module.exports = {
|
||||
// Extract custom resolver or type description.
|
||||
const { resolver: handler = {} } = _schema;
|
||||
|
||||
const queryName = `${action}${_.capitalize(name)}`;
|
||||
let queryName = `${action}${_.capitalize(name)}`;
|
||||
|
||||
if (_.has(handler, `Mutation.${action}`)) {
|
||||
queryName = action;
|
||||
}
|
||||
|
||||
// Retrieve policies.
|
||||
const policies = _.get(handler, `Mutation.${queryName}.policies`, []);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user