diff --git a/handler/graphql.go b/handler/graphql.go index b09c344f54..1e085ecd16 100644 --- a/handler/graphql.go +++ b/handler/graphql.go @@ -315,7 +315,7 @@ func GraphQL(exec graphql.ExecutableSchema, options ...Option) http.HandlerFunc }() if reqCtx.ComplexityLimit > 0 && reqCtx.OperationComplexity > cfg.complexityLimit { - sendErrorf(w, http.StatusUnprocessableEntity, "operation has complexity %d, which exceeds the limit of %d", operationComplexity, cfg.complexityLimit) + sendErrorf(w, http.StatusUnprocessableEntity, "operation has complexity %d, which exceeds the limit of %d", reqCtx.OperationComplexity, reqCtx.ComplexityLimit) return } diff --git a/handler/websocket.go b/handler/websocket.go index af7d7a5a4e..dae262bdf3 100644 --- a/handler/websocket.go +++ b/handler/websocket.go @@ -165,7 +165,7 @@ func (c *wsConnection) subscribe(message *operationMessage) bool { c.sendError(message.ID, err) return true } - reqCtx := c.cfg.newRequestContext(doc, reqParams.Query, vars) + reqCtx := c.cfg.newRequestContext(c.exec, doc, op, reqParams.Query, vars) ctx := graphql.WithRequestContext(c.ctx, reqCtx) if c.initPayload != nil {