From ff5419514feab989531d52d775b1cbe33e6ce51e Mon Sep 17 00:00:00 2001 From: Ivan Goncharov Date: Mon, 12 Apr 2021 00:05:55 +0300 Subject: [PATCH] printSchema: replace array concat with spead + update comment (#3035) --- src/utilities/printSchema.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) 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.