mirror of
https://github.com/strapi/strapi.git
synced 2025-12-16 01:34:23 +00:00
Don't run shadowCRUD related operations if it's disabled
This commit is contained in:
parent
c31478b01d
commit
a303b0e5c4
@ -11,9 +11,15 @@ const DELETE_FILE_MUTATION_NAME = 'removeFile';
|
||||
const FILE_INFO_INPUT_TYPE_NAME = 'FileInfoInput';
|
||||
|
||||
module.exports = ({ strapi }) => {
|
||||
const { service: getGraphQLService } = strapi.plugin('graphql');
|
||||
const { service: getGraphQLService, config: graphQLConfig } = strapi.plugin('graphql');
|
||||
const { service: getUploadService } = strapi.plugin('upload');
|
||||
|
||||
const isShadowCRUDEnabled = graphQLConfig('shadowCRUD', true);
|
||||
|
||||
if (!isShadowCRUDEnabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
const { getTypeName, getEntityResponseName } = getGraphQLService('utils').naming;
|
||||
const { toEntityResponse } = getGraphQLService('format').returnTypes;
|
||||
|
||||
|
||||
@ -5,8 +5,15 @@ const getQueries = require('./queries');
|
||||
const getMutations = require('./mutations');
|
||||
|
||||
module.exports = ({ strapi }) => {
|
||||
const { config: graphQLConfig } = strapi.plugin('graphql');
|
||||
const extensionService = strapi.plugin('graphql').service('extension');
|
||||
|
||||
const isShadowCRUDEnabled = graphQLConfig('shadowCRUD', true);
|
||||
|
||||
if (!isShadowCRUDEnabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Disable Permissions queries & mutations but allow the
|
||||
// type to be used/selected in filters or nested resolvers
|
||||
extensionService
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user