Great! can you share the repo if it is public?
FYI, the auth header is accessible to the lambda server. The HTTP body that is sent to the lambda server from Dgraph Alpha looks like this:
{
"resolver": "Query.todoTitles",
"parents": [{...}, {...}, ...],
"args": {...},
"authHeader": {
"key": "<the-name-of-the-auth-header, e.g.: X-Auth-Token>",
"value": "<value-of-the-auth-header, i.e., the JWT>"
}
}
If you are using dgraph-lambda, then authHeader
is automatically applied to the graphql()
calls inside the lambda resolver:
async function todoTitles({ graphql }) {
const results = await graphql('{ queryTodo { title } }')
return results.data.queryTodo.map(t => t.title)
}
If you would require any other headers from the client on lambda server, let us know your use-case and we can think about supporting that.
Thanks