Skip to content

Commit

Permalink
updated sample code for disabling introspection
Browse files Browse the repository at this point in the history
  • Loading branch information
sanjeevchopra authored Jan 28, 2021
1 parent 997da42 commit 0e9d9c3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/content/reference/introspection.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 0e9d9c3

Please sign in to comment.