diff --git a/src/utilities/printSchema.js b/src/utilities/printSchema.js index f2a4d15226..f68ab4187a 100644 --- a/src/utilities/printSchema.js +++ b/src/utilities/printSchema.js @@ -58,11 +58,11 @@ function printFilteredSchema( const directives = schema.getDirectives().filter(directiveFilter); const types = Object.values(schema.getTypeMap()).filter(typeFilter); - return [printSchemaDefinition(schema)] - .concat( - directives.map((directive) => printDirective(directive)), - types.map((type) => printType(type)), - ) + return [ + printSchemaDefinition(schema), + ...directives.map((directive) => printDirective(directive)), + ...types.map((type) => printType(type)), + ] .filter(Boolean) .join('\n\n'); } @@ -100,6 +100,7 @@ function printSchemaDefinition(schema: GraphQLSchema): ?string { * schema { * query: Query * mutation: Mutation + * subscription: Subscription * } * * When using this naming convention, the schema description can be omitted.