feat : GraphQL Context 구현체 추가

This commit is contained in:
banjjoknim
2022-08-02 15:06:41 +09:00
parent 1721962444
commit 738246a31f

View File

@@ -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(
override suspend fun generateContextMap(request: ServerRequest): Map<*, Any> {
return super.generateContextMap(request) + mapOf(
"myCustomValue" to (request.headers().firstHeader("MyHeader") ?: "defaultContext")
)
}
}