From 0e9d9c3a9d072c6e2262bf742705d723be8d2508 Mon Sep 17 00:00:00 2001 From: sanjeevchopra Date: Wed, 27 Jan 2021 17:16:11 -0800 Subject: [PATCH] updated sample code for disabling introspection --- docs/content/reference/introspection.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/reference/introspection.md b/docs/content/reference/introspection.md index daa26c6cb01..c1acb1e8160 100644 --- a/docs/content/reference/introspection.md +++ b/docs/content/reference/introspection.md @@ -29,7 +29,7 @@ Introspection can also be enabled on a per-request context basis. For example, y srv := handler.NewDefaultServer(es) srv.AroundOperations(func(ctx context.Context, next graphql.OperationHandler) graphql.ResponseHandler { if !userForContext(ctx).IsAdmin { - graphql.GetOperationContext(ctx).DisableIntrospection = true + graphql.GetRequestContext(ctx).DisableIntrospection = true } return next(ctx)