diff --git a/handler.go b/handler.go index ec38df7..d78457f 100644 --- a/handler.go +++ b/handler.go @@ -112,6 +112,10 @@ func (h *Handler) ContextHandler(ctx context.Context, w http.ResponseWriter, r * // get query opts := NewRequestOptions(r) + // send the authorization header with the root object + root := make(map[string]interface{}) + root["Authorization"] = r.Header.Get("Authorization") + // execute graphql query params := graphql.Params{ Schema: *h.Schema, @@ -119,6 +123,7 @@ func (h *Handler) ContextHandler(ctx context.Context, w http.ResponseWriter, r * VariableValues: opts.Variables, OperationName: opts.OperationName, Context: ctx, + RootObject: root, } result := graphql.Do(params)