:wave: I am wondering how to get a request header...
# kgraphql
a
👋 I am wondering how to get a request header in my resolver. I am assuming there is a way to grab it with the Context. However I can't seem to find an example and have been unable to figure it out on my end.
n
Hi Andres! I did it as you assume, with the context:
Copy code
fun Application.configureGraphQL() {
    install(GraphQL) {
        playground = true
        context { call ->
            val headers = call.request.headers
            inject(headers)
        }
        configureSchema()
    }
}
In that example I put all the headers in the context... So I can get it with:
ctx.get(Headers::class)
a
Awesome I will try this out later. Thanks for the help!
worked thanks again!