Documentation ¶
Index ¶
- type GQL
- func (g *GQL) GetSchema() (*graphql.Schema, error)
- func (g *GQL) NewHandler(cfg *handler.Config) http.Handler
- func (g *GQL) RegisterInject(injectFn interface{})
- func (g *GQL) RegisterMutation(mutation interface{})
- func (g *GQL) RegisterMutationWithValidateFn(mutation interface{}, validateFn gqlh.ValidatorFn)
- func (g *GQL) RegisterQuery(query interface{})
- func (g *GQL) RegisterQueryWithValidateFn(query interface{}, validateFn gqlh.ValidatorFn)
- func (g *GQL) Summary() string
- func (g *GQL) SummaryOfFailed() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GQL ¶
type GQL struct {
// contains filtered or unexported fields
}
GQL GraphSQL 辅助类
func (*GQL) NewHandler ¶
NewHandler 设置 json 是否格式化
func (*GQL) RegisterInject ¶
func (g *GQL) RegisterInject(injectFn interface{})
RegisterInject 注册注入函数,只是加入到待注册列表 @param injectFn 必须是一个函数,且函数必须是一下形式
func injectFn(ctx, context.Context, r *http.Request, gp *graphql.ResolveParams) *CustomStruct
func (*GQL) RegisterMutation ¶
func (g *GQL) RegisterMutation(mutation interface{})
RegisterMutation 注册操作,加入到待注册列表 @param mutation 可以是一个函数,也可以是一个有多个函数的结构体
func (*GQL) RegisterMutationWithValidateFn ¶
func (g *GQL) RegisterMutationWithValidateFn(mutation interface{}, validateFn gqlh.ValidatorFn)
RegisterMutationWithValidateFn 注册操作,并提供输入参数验证函数
func (*GQL) RegisterQuery ¶
func (g *GQL) RegisterQuery(query interface{})
RegisterQuery 注册查询 @param query 可以是一个函数,也可以是一个有多个函数的结构体
func (*GQL) RegisterQueryWithValidateFn ¶
func (g *GQL) RegisterQueryWithValidateFn(query interface{}, validateFn gqlh.ValidatorFn)
RegisterQueryWithValidateFn 注册查询,并提供一个输入参数验证函数 @param query 可以是一个函数,也可以是一个有多个函数的结构体
Click to show internal directories.
Click to hide internal directories.