...

Source file src/github.com/99designs/gqlgen/graphql/handler/extension/introspection.go

Documentation: github.com/99designs/gqlgen/graphql/handler/extension

     1  package extension
     2  
     3  import (
     4  	"context"
     5  
     6  	"github.com/vektah/gqlparser/v2/gqlerror"
     7  
     8  	"github.com/99designs/gqlgen/graphql"
     9  )
    10  
    11  // EnableIntrospection enables clients to reflect all of the types available on the graph.
    12  type Introspection struct{}
    13  
    14  var _ interface {
    15  	graphql.OperationContextMutator
    16  	graphql.HandlerExtension
    17  } = Introspection{}
    18  
    19  func (c Introspection) ExtensionName() string {
    20  	return "Introspection"
    21  }
    22  
    23  func (c Introspection) Validate(schema graphql.ExecutableSchema) error {
    24  	return nil
    25  }
    26  
    27  func (c Introspection) MutateOperationContext(ctx context.Context, rc *graphql.OperationContext) *gqlerror.Error {
    28  	rc.DisableIntrospection = false
    29  	return nil
    30  }
    31  

View as plain text