graphqlserver

package
v1.17.10 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 1, 2024 License: Apache-2.0 Imports: 30 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewServer

func NewServer(service factory.ServiceFactory, opts ...OptionFunc) factory.AppServerFactory

NewServer create new GraphQL server

Types

type Handler

type Handler interface {
	ServeGraphQL() http.HandlerFunc
	ServePlayground(resp http.ResponseWriter, req *http.Request)
	ServeVoyager(resp http.ResponseWriter, req *http.Request)
}

Handler interface

func ConstructHandlerFromService added in v1.14.5

func ConstructHandlerFromService(service factory.ServiceFactory, opt Option) Handler

ConstructHandlerFromService for create public graphql handler (maybe inject to rest handler)

func NewHandler

func NewHandler(schema *graphql.Schema, opt Option) Handler

NewHandler init new graphql http handler

type Option added in v1.12.0

type Option struct {
	DisableIntrospection bool
	RootPath             string
	// contains filtered or unexported fields
}

Option gql server

type OptionFunc added in v1.7.4

type OptionFunc func(*Option)

OptionFunc type

func AddDirectiveFunc added in v1.12.0

func AddDirectiveFunc(directiveName string, handlerFunc types.DirectiveFunc) OptionFunc

AddDirectiveFunc option func

func SetDebugMode added in v1.7.4

func SetDebugMode(debugMode bool) OptionFunc

SetDebugMode option func

func SetDisableIntrospection added in v1.7.4

func SetDisableIntrospection(disableIntrospection bool) OptionFunc

SetDisableIntrospection option func

func SetHTTPPort added in v1.7.4

func SetHTTPPort(port uint16) OptionFunc

SetHTTPPort option func

func SetJaegerMaxPacketSize added in v1.7.4

func SetJaegerMaxPacketSize(max int) OptionFunc

SetJaegerMaxPacketSize option func

func SetRootHTTPHandler added in v1.7.4

func SetRootHTTPHandler(rootHandler http.Handler) OptionFunc

SetRootHTTPHandler option func

func SetRootPath added in v1.7.4

func SetRootPath(rootPath string) OptionFunc

SetRootPath option func

func SetRootResolver added in v1.15.9

func SetRootResolver(resolver interfaces.GraphQLHandler) OptionFunc

SetRootResolver option func

func SetSchemaSource added in v1.17.9

func SetSchemaSource(schema []byte) OptionFunc

SetSchemaSource option func

func SetSharedListener added in v1.7.4

func SetSharedListener(sharedListener cmux.CMux) OptionFunc

SetSharedListener option func

func SetTLSConfig added in v1.17.0

func SetTLSConfig(tlsConfig *tls.Config) OptionFunc

SetTLSConfig option func

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL