Versions in this module Expand all Collapse all v0 v0.0.3 May 5, 2024 v0.0.2 May 5, 2024 v0.0.1 May 5, 2024 Changes in this version + const DefaultMaxSubscriptions + const DefaultMinRerunInterval + const IF + const INCLUDE + const SKIP + func CheckNonExpensive(ctx context.Context) bool + func CreateConnection(ctx context.Context, socket JSONSocket, schema *Schema, ...) *conn + func CreateJSONSocket(ctx context.Context, socket JSONSocket, schema *Schema, makeCtx MakeCtxFunc, ...) *conn + func CreateJSONSocketWithMutationSchema(ctx context.Context, socket JSONSocket, schema, mutationSchema *Schema, ...) *conn + func ErrorCause(err error) error + func HTTPHandler(schema *Schema, middlewares ...MiddlewareFunc) http.Handler + func HTTPHandlerWithExecutor(schema *Schema, executor ExecutorRunner, middlewares ...MiddlewareFunc) http.Handler + func Handler(schema *Schema) http.Handler + func NewClientError(format string, a ...interface{}) error + func NewSafeError(format string, a ...interface{}) error + func PrepareQuery(ctx context.Context, typ Type, selectionSet *SelectionSet) error + func SafeExecuteBatchResolver(ctx context.Context, field *Field, sources []interface{}, args interface{}, ...) (results []interface{}, err error) + func SafeExecuteResolver(ctx context.Context, field *Field, source, args interface{}, ...) (result interface{}, err error) + func SanitizeError(err error) string + func ServeJSONSocket(ctx context.Context, socket JSONSocket, schema *Schema, makeCtx MakeCtxFunc, ...) + func ShouldIncludeNode(directives []*Directive) (bool, error) + func WrapAsSafeError(err error, format string, a ...interface{}) error + type AlwaysSpawnGoroutineFunc func(context.Context, *Query) bool + type BatchResolver func(ctx context.Context, sources []interface{}, args interface{}, ...) ([]interface{}, error) + type ClientError SafeError + func (e ClientError) Error() string + func (e ClientError) SanitizedError() string + type ComputationInput struct + Ctx context.Context + Extensions map[string]interface{} + Id string + IsInitialComputation bool + ParsedQuery *Query + Previous interface{} + Query string + Variables map[string]interface{} + type ComputationOutput struct + Current interface{} + Error error + Metadata map[string]interface{} + func RunMiddlewares(middlewares []MiddlewareFunc, input *ComputationInput) *ComputationOutput + type ConnectionOption func(*conn) + func WithAlwaysSpawnGoroutineFunc(fn AlwaysSpawnGoroutineFunc) ConnectionOption + func WithExecutionLogger(logger GraphqlLogger) ConnectionOption + func WithExecutor(executor ExecutorRunner) ConnectionOption + func WithMakeCtx(makeCtx MakeCtxFunc) ConnectionOption + func WithMaxSubscriptions(max int) ConnectionOption + func WithMinRerunInterval(d time.Duration) ConnectionOption + func WithMinRerunIntervalFunc(fn RerunIntervalFunc) ConnectionOption + func WithMutationSchema(schema *Schema) ConnectionOption + func WithSubscriptionLogger(logger SubscriptionLogger) ConnectionOption + type Directive struct + Args interface{} + Name string + type Enum struct + ReverseMap map[interface{}]string + Type string + Values []string + func (e *Enum) String() string + type Executor struct + func (e *Executor) Execute(ctx context.Context, typ Type, source interface{}, query *Query) (interface{}, error) + type ExecutorRunner interface + Execute func(ctx context.Context, typ Type, source interface{}, query *Query) (interface{}, error) + func NewExecutor(scheduler WorkScheduler) ExecutorRunner + type Field struct + Args map[string]Type + Batch bool + BatchResolver BatchResolver + Expensive bool + External bool + FederatedKey map[string]bool + NumParallelInvocationsFunc func(ctx context.Context, numNodes int) int + ParseArguments func(json interface{}) (interface{}, error) + Resolve Resolver + Type Type + UseBatchFunc func(context.Context) bool + type Fragment struct + Directives []*Directive + On string + SelectionSet *SelectionSet + type GraphqlLogger interface + Error func(ctx context.Context, err error, tags map[string]string) + FinishExecution func(ctx context.Context, tags map[string]string, delay time.Duration) + StartExecution func(ctx context.Context, tags map[string]string, initial bool) + type InputObject struct + InputFields map[string]Type + Name string + func (io *InputObject) String() string + type JSONSocket interface + Close func() error + ReadJSON func(value interface{}) error + WriteJSON func(value interface{}) error + type List struct + Type Type + func (l *List) String() string + type MakeCtxFunc func(context.Context) context.Context + type MiddlewareFunc func(input *ComputationInput, next MiddlewareNextFunc) *ComputationOutput + type MiddlewareNextFunc func(input *ComputationInput) *ComputationOutput + type NonNull struct + Type Type + func (n *NonNull) String() string + type Object struct + Description string + Fields map[string]*Field + KeyField *Field + Name string + func (o *Object) String() string + type Query struct + Kind string + Name string + func MustParse(source string, vars map[string]interface{}) *Query + func Parse(source string, vars map[string]interface{}) (*Query, error) + type RerunIntervalFunc func(context.Context, *Query) time.Duration + type Resolver func(ctx context.Context, source, args interface{}, selectionSet *SelectionSet) (interface{}, error) + type SafeError struct + func (e SafeError) Error() string + func (e SafeError) Reason() string + func (e SafeError) SanitizedError() string + func (e SafeError) Unwrap() error + type SanitizedError interface + SanitizedError func() string + type Scalar struct + Type string + Unwrapper func(interface{}) (interface{}, error) + func (s *Scalar) String() string + type Schema struct + Mutation Type + Query Type + type Selection struct + Alias string + Args interface{} + Directives []*Directive + Name string + ParentType string + SelectionSet *SelectionSet + UnparsedArgs map[string]interface{} + func Flatten(selectionSet *SelectionSet) ([]*Selection, error) + type SelectionSet struct + Fragments []*Fragment + Selections []*Selection + func (s *SelectionSet) ShallowCopy() *SelectionSet + type SubscriptionLogger interface + Subscribe func(ctx context.Context, id string, tags map[string]string) + Unsubscribe func(ctx context.Context, id string) + type Type interface + String func() string + type Union struct + Description string + Name string + Types map[string]*Object + func (u *Union) String() string + type UnitResolver func(*WorkUnit) []*WorkUnit + type WorkScheduler interface + Run func(resolver UnitResolver, startingUnits ...*WorkUnit) + func NewImmediateGoroutineScheduler() WorkScheduler + type WorkUnit struct + Ctx context.Context + func (w *WorkUnit) IsBatch() bool + func (w *WorkUnit) IsExpensive() bool + func (w *WorkUnit) Selection() *Selection