Documentation ¶
Index ¶
- func NewServer(service factory.ServiceFactory, opts ...OptionFunc) factory.AppServerFactory
- type Handler
- type Option
- type OptionFunc
- func AddDirectiveFunc(directiveName string, dirFuncs types.DirectiveFunc) OptionFunc
- func SetDebugMode(debugMode bool) OptionFunc
- func SetDisableIntrospection(disableIntrospection bool) OptionFunc
- func SetHTTPPort(port uint16) OptionFunc
- func SetJaegerMaxPacketSize(max int) OptionFunc
- func SetRootHTTPHandler(rootHandler http.Handler) OptionFunc
- func SetRootMutation(resolver interface{}) OptionFunc
- func SetRootPath(rootPath string) OptionFunc
- func SetRootQuery(resolver interface{}) OptionFunc
- func SetRootSubscription(resolver interface{}) OptionFunc
- func SetSharedListener(sharedListener cmux.CMux) OptionFunc
- type RootResolver
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 NewHandler ¶
func NewHandler(service factory.ServiceFactory, opt Option) Handler
NewHandler for create public graphql handler (maybe inject to rest handler)
type Option ¶ added in v1.12.0
type Option struct { DisableIntrospection bool // 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, dirFuncs 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 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 SetRootMutation ¶ added in v1.12.0
func SetRootMutation(resolver interface{}) OptionFunc
SetRootMutation option func
func SetRootPath ¶ added in v1.7.4
func SetRootPath(rootPath string) OptionFunc
SetRootPath option func
func SetRootQuery ¶ added in v1.12.0
func SetRootQuery(resolver interface{}) OptionFunc
SetRootQuery option func
func SetRootSubscription ¶
func SetRootSubscription(resolver interface{}) OptionFunc
SetRootSubscription public function this public method created because cannot create dynamic method for embedded struct (issue https://github.com/golang/go/issues/15924) and subscription in graphql cannot subscribe to at most one subscription at a time
func SetSharedListener ¶ added in v1.7.4
func SetSharedListener(sharedListener cmux.CMux) OptionFunc
SetSharedListener option func
type RootResolver ¶ added in v1.12.0
type RootResolver struct {
// contains filtered or unexported fields
}
RootResolver root issue https://github.com/graph-gophers/graphql-go/issues/145
func (*RootResolver) Mutation ¶ added in v1.12.0
func (r *RootResolver) Mutation() interface{}
func (*RootResolver) Query ¶ added in v1.12.0
func (r *RootResolver) Query() interface{}
func (*RootResolver) Subscription ¶ added in v1.12.0
func (r *RootResolver) Subscription() interface{}