Skip to content

Commit

Permalink
Avoid enabling "graphql-extensions" when none are in use (apollograph…
Browse files Browse the repository at this point in the history
  • Loading branch information
DrewML committed Feb 3, 2021
1 parent 902e2c4 commit 1b65bcf
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/apollo-server-core/src/requestPipeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,11 @@ export async function processGraphQLRequest<TContext>(
}

function initializeExtensionStack(): GraphQLExtensionStack<TContext> {
enableGraphQLExtensions(config.schema);
if (config.extensions?.length) {
// graphql-extensions adds some overhead to field resolvers.
// Only enable extensions when at least 1 extension has been provided
enableGraphQLExtensions(config.schema);
}

// If custom extension factories were provided, create per-request extension
// objects.
Expand Down

0 comments on commit 1b65bcf

Please sign in to comment.