From 74bf2347913d9b2dd192bd96f4258e627defcaee Mon Sep 17 00:00:00 2001 From: Daniel Cousens <413395+dcousens@users.noreply.github.com> Date: Wed, 24 Jan 2024 17:07:44 +1100 Subject: [PATCH] prefer ?. for optional branching --- packages/core/src/lib/createGraphQLSchema.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/core/src/lib/createGraphQLSchema.ts b/packages/core/src/lib/createGraphQLSchema.ts index e035baf598c..0c611ab3b19 100644 --- a/packages/core/src/lib/createGraphQLSchema.ts +++ b/packages/core/src/lib/createGraphQLSchema.ts @@ -108,9 +108,7 @@ export function createGraphQLSchema ( endSession: graphql.field({ type: graphql.nonNull(graphql.Boolean), async resolve (rootVal, args, context) { - if (context.sessionStrategy) { - await context.sessionStrategy.end({ context }) - } + await context.sessionStrategy?.end({ context }) return true }, }),