From 738246a31feb873d99ec9ebfebf3779ec8c1c470 Mon Sep 17 00:00:00 2001 From: banjjoknim Date: Tue, 2 Aug 2022 15:06:41 +0900 Subject: [PATCH] =?UTF-8?q?feat=20:=20GraphQL=20Context=20=EA=B5=AC?= =?UTF-8?q?=ED=98=84=EC=B2=B4=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../kotlin/com/banjjoknim/graphqlkotlin/GraphQLContextFactory.kt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/놀이터(예제 코드 작성)/graphql-kotlin/src/main/kotlin/com/banjjoknim/graphqlkotlin/GraphQLContextFactory.kt b/놀이터(예제 코드 작성)/graphql-kotlin/src/main/kotlin/com/banjjoknim/graphqlkotlin/GraphQLContextFactory.kt index cce6a40..9666713 100644 --- a/놀이터(예제 코드 작성)/graphql-kotlin/src/main/kotlin/com/banjjoknim/graphqlkotlin/GraphQLContextFactory.kt +++ b/놀이터(예제 코드 작성)/graphql-kotlin/src/main/kotlin/com/banjjoknim/graphqlkotlin/GraphQLContextFactory.kt @@ -23,7 +23,9 @@ import org.springframework.web.reactive.function.server.ServerRequest */ @Component class GraphQLContextFactory : DefaultSpringGraphQLContextFactory() { - override suspend fun generateContextMap(request: ServerRequest): Map<*, Any> = super.generateContextMap(request) + mapOf( - "myCustomValue" to (request.headers().firstHeader("MyHeader") ?: "defaultContext") - ) + override suspend fun generateContextMap(request: ServerRequest): Map<*, Any> { + return super.generateContextMap(request) + mapOf( + "myCustomValue" to (request.headers().firstHeader("MyHeader") ?: "defaultContext") + ) + } }