Skip to content

Commit

Permalink
Update introspection.md
Browse files Browse the repository at this point in the history
updated disabling interospect
  • Loading branch information
Captain-K-101 authored Oct 15, 2020
1 parent 3a31a75 commit 0625525
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions docs/content/reference/introspection.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ One of the best features of GraphQL is it's powerful discoverability, but someti
To turn introspection on and off at runtime, pass the `IntrospectionEnabled` handler option when starting the server:

```go
srv := httptest.NewServer(
handler.GraphQL(
NewExecutableSchema(Config{Resolvers: resolvers}),
handler.IntrospectionEnabled(false),
),
)

srv := handler.NewDefaultServer(NewExecutableSchema(Config{Resolvers: resolvers}))
srv.AroundOperations(func(ctx context.Context, next graphql.OperationHandler) graphql.ResponseHandler {
graphql.GetOperationContext(ctx).DisableIntrospection = true
return next(ctx)
})
```

## Disabling introspection based on authentication
Expand Down

0 comments on commit 0625525

Please sign in to comment.