Hi, I'm trying to build spring server with version 4.0.0-alpha13 and it seems the guide is unable to be applied on GraphQLContextFactory.
interface GraphQLContextFactory<out Context : GraphQLContext, Request> {
fun generateContext(request: Request): Context?
}
Now GraphQLContextFactory does not support suspend modifier. I tried to load user entity from DB on ContextFactory as the guide has referred, but the implementation is different.
@Component
class MyGraphQLContextFactory: GraphQLContextFactory<MyGraphQLContext> {
override suspend fun generateContext(
request: ServerHttpRequest,
response: ServerHttpResponse
): MyGraphQLContext = MyGraphQLContext(
myCustomValue = request.headers.getFirst("MyHeader") ?: "defaultValue"
)
}
Can I know workaround to do it?