The purpose of attaching the x-auth0-token was to make use of dgraph’s auth directive so that I can manage access control according to user’s role at a type level. I wrote some custom rules in the authentication layer to append claims to indicate user role and would like to pass this auth token while making queries so that dgraph could validate the request.
Am I correct in assuming that this functionality works with DQL queries as well? I moved from Apollo client to dgraph-js-http in favor of being able to send DQL queries but while Apollo seemed to have handled attaching the x-auth0-token in header well, I had trouble doing the same with dgraph-js-http.
PS. I understand from further reading that the auth directive is limited to GraphQL and does not apply to DQL. I’d love to see this feature apply to DQL in the future, but for now I think I’ll have to write the access control rules serverside and forward the request to dgraph on validating the claims.