Don't remove Subscription type if subscriptions are disabled

This commit is contained in:
Convly 2021-11-12 10:05:11 +01:00
parent a7592e04a9
commit cf96129d7c

View File

@ -25,7 +25,6 @@ const introspectionQueries = [
* @return {GraphQLSchema}
*/
const wrapResolvers = ({ schema, strapi, extension = {} }) => {
const { config: graphQLConfig } = strapi.plugin('graphql');
// Get all the registered resolvers configuration
const { resolversConfig = {} } = extension;
@ -34,10 +33,6 @@ const wrapResolvers = ({ schema, strapi, extension = {} }) => {
const typeMap = schema.getTypeMap();
if (!graphQLConfig('subscriptions')) {
delete typeMap.Subscription;
}
Object.entries(typeMap).forEach(([type, definition]) => {
const isGraphQLObjectType = definition instanceof GraphQLObjectType;
const isIgnoredType = introspectionQueries.includes(type);