Documentation
¶
Index ¶
- Variables
- func ErrResolver(err error) graphql.FieldResolveFn
- func PassthroughResolver(p graphql.ResolveParams) (any, error)
- func ToResolver[P any, A any, R any](f func(*Context, P, A) (R, error)) graphql.FieldResolveFn
- type Context
- type ExecutableSchema
- type InvalidInputError
- type LoadedSchema
- type ObjectResolver
- type Resolver
- type Resolvers
- type Router
- func (r *Router) Add(schema ExecutableSchema) error
- func (r *Router) Do(ctx context.Context, query string, opName string, variables map[string]any, ...) (*graphql.Result, error)
- func (r *Router) Get(name string) ExecutableSchema
- func (r *Router) ServeConn(conn net.Conn) error
- func (r *Router) ServeHTTP(w http.ResponseWriter, req *http.Request)
- type ScalarResolver
- type StaticSchemaParams
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func ErrResolver ¶
func ErrResolver(err error) graphql.FieldResolveFn
func PassthroughResolver ¶
func PassthroughResolver(p graphql.ResolveParams) (any, error)
func ToResolver ¶
ToResolver transforms any function f with a *Context, a parent P and some args A that returns a Response R and an error into a graphql resolver graphql.FieldResolveFn.
Types ¶
type ExecutableSchema ¶
type ExecutableSchema interface { LoadedSchema Resolvers() Resolvers Dependencies() []ExecutableSchema }
func MergeExecutableSchemas ¶
func MergeExecutableSchemas(name string, schemas ...ExecutableSchema) (ExecutableSchema, error)
func StaticSchema ¶
func StaticSchema(p StaticSchemaParams) ExecutableSchema
type InvalidInputError ¶ added in v0.3.3
type InvalidInputError struct {
Err error
}
func (InvalidInputError) Error ¶ added in v0.3.3
func (e InvalidInputError) Error() string
func (InvalidInputError) Unwrap ¶ added in v0.3.3
func (e InvalidInputError) Unwrap() error
type LoadedSchema ¶
func MergeLoadedSchemas ¶
func MergeLoadedSchemas(name string, schemas ...LoadedSchema) LoadedSchema
type ObjectResolver ¶
type ObjectResolver map[string]graphql.FieldResolveFn
type Router ¶
type Router struct {
// contains filtered or unexported fields
}
func (*Router) Add ¶
func (r *Router) Add(schema ExecutableSchema) error
func (*Router) Do ¶
func (r *Router) Do(ctx context.Context, query string, opName string, variables map[string]any, data any) (*graphql.Result, error)
Do executes a query directly in the server
func (*Router) Get ¶
func (r *Router) Get(name string) ExecutableSchema
type ScalarResolver ¶
type ScalarResolver struct { Serialize graphql.SerializeFn ParseValue graphql.ParseValueFn ParseLiteral graphql.ParseLiteralFn }
type StaticSchemaParams ¶
type StaticSchemaParams struct { Name string Schema string Resolvers Resolvers Dependencies []ExecutableSchema }
Click to show internal directories.
Click to hide internal directories.