diff --git a/src/pages/graphql-js/authentication-and-express-middleware.mdx b/src/pages/graphql-js/authentication-and-express-middleware.mdx index 0cfd8d6a13..617eb0fa05 100644 --- a/src/pages/graphql-js/authentication-and-express-middleware.mdx +++ b/src/pages/graphql-js/authentication-and-express-middleware.mdx @@ -26,8 +26,8 @@ function loggingMiddleware(req, res, next) { } var root = { - ip(args, request) { - return request.ip + ip(args, context) { + return context.ip }, } @@ -38,7 +38,9 @@ app.all( createHandler({ schema: schema, rootValue: root, - graphiql: true, + context: req => ({ + ip: req.raw.ip, + }), }) ) app.listen(4000)