package handler
import "github.com/99designs/gqlgen/graphql/handler"
Index ¶
- type FieldFunc
- func (f FieldFunc) ExtensionName() string
- func (f FieldFunc) InterceptField(ctx context.Context, next graphql.Resolver) (res any, err error)
- func (f FieldFunc) Validate(schema graphql.ExecutableSchema) error
- type OperationFunc
- func (r OperationFunc) ExtensionName() string
- func (r OperationFunc) InterceptOperation(ctx context.Context, next graphql.OperationHandler) graphql.ResponseHandler
- func (r OperationFunc) Validate(schema graphql.ExecutableSchema) error
- type ResponseFunc
- func (r ResponseFunc) ExtensionName() string
- func (r ResponseFunc) InterceptResponse(ctx context.Context, next graphql.ResponseHandler) *graphql.Response
- func (r ResponseFunc) Validate(schema graphql.ExecutableSchema) error
- type Server
- func New(es graphql.ExecutableSchema) *Server
- func NewDefaultServer(es graphql.ExecutableSchema) *Server
- func (s *Server) AddTransport(transport graphql.Transport)
- func (s *Server) AroundFields(f graphql.FieldMiddleware)
- func (s *Server) AroundOperations(f graphql.OperationMiddleware)
- func (s *Server) AroundResponses(f graphql.ResponseMiddleware)
- func (s *Server) AroundRootFields(f graphql.RootFieldMiddleware)
- func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (s *Server) SetDisableSuggestion(value bool)
- func (s *Server) SetErrorPresenter(f graphql.ErrorPresenterFunc)
- func (s *Server) SetParserTokenLimit(limit int)
- func (s *Server) SetQueryCache(cache graphql.Cache[*ast.QueryDocument])
- func (s *Server) SetRecoverFunc(f graphql.RecoverFunc)
- func (s *Server) Use(extension graphql.HandlerExtension)
Types ¶
type FieldFunc ¶
func (FieldFunc) ExtensionName ¶
func (FieldFunc) InterceptField ¶
func (FieldFunc) Validate ¶
func (f FieldFunc) Validate(schema graphql.ExecutableSchema) error
type OperationFunc ¶
type OperationFunc func(ctx context.Context, next graphql.OperationHandler) graphql.ResponseHandler
func (OperationFunc) ExtensionName ¶
func (r OperationFunc) ExtensionName() string
func (OperationFunc) InterceptOperation ¶
func (r OperationFunc) InterceptOperation(ctx context.Context, next graphql.OperationHandler) graphql.ResponseHandler
func (OperationFunc) Validate ¶
func (r OperationFunc) Validate(schema graphql.ExecutableSchema) error
type ResponseFunc ¶
func (ResponseFunc) ExtensionName ¶
func (r ResponseFunc) ExtensionName() string
func (ResponseFunc) InterceptResponse ¶
func (r ResponseFunc) InterceptResponse(ctx context.Context, next graphql.ResponseHandler) *graphql.Response
func (ResponseFunc) Validate ¶
func (r ResponseFunc) Validate(schema graphql.ExecutableSchema) error
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func New ¶
func New(es graphql.ExecutableSchema) *Server
func NewDefaultServer ¶
func NewDefaultServer(es graphql.ExecutableSchema) *Server
NewDefaultServer is a demonstration only. Not for prod.
Currently, the server just picks the first available transport, so this example NewDefaultServer orders them, but it is just for demonstration purposes. You will likely want to tune and better configure Websocket transport since adding a new one (To configure it) doesn't have effect.
Also SSE support is not in here at all! SSE when used over HTTP/1.1 (but not HTTP/2 or HTTP/3), SSE suffers from a severe limitation to the maximum number of open connections of 6 per browser. See: https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#sect1
Deprecated: This was and is just an example.
func (*Server) AddTransport ¶
func (*Server) AroundFields ¶
func (s *Server) AroundFields(f graphql.FieldMiddleware)
AroundFields is a convenience method for creating an extension that only implements field middleware
func (*Server) AroundOperations ¶
func (s *Server) AroundOperations(f graphql.OperationMiddleware)
AroundOperations is a convenience method for creating an extension that only implements operation middleware
func (*Server) AroundResponses ¶
func (s *Server) AroundResponses(f graphql.ResponseMiddleware)
AroundResponses is a convenience method for creating an extension that only implements response middleware
func (*Server) AroundRootFields ¶
func (s *Server) AroundRootFields(f graphql.RootFieldMiddleware)
AroundRootFields is a convenience method for creating an extension that only implements field middleware
func (*Server) ServeHTTP ¶
func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)
func (*Server) SetDisableSuggestion ¶
func (*Server) SetErrorPresenter ¶
func (s *Server) SetErrorPresenter(f graphql.ErrorPresenterFunc)
func (*Server) SetParserTokenLimit ¶
func (*Server) SetQueryCache ¶
func (s *Server) SetQueryCache(cache graphql.Cache[*ast.QueryDocument])
func (*Server) SetRecoverFunc ¶
func (s *Server) SetRecoverFunc(f graphql.RecoverFunc)
func (*Server) Use ¶
func (s *Server) Use(extension graphql.HandlerExtension)
Source Files ¶
Directories ¶
- Version
- v0.17.73 (latest)
- Published
- May 2, 2025
- Platform
- linux/amd64
- Imports
- 13 packages
- Last checked
- 3 days ago –
Tools for package owners.