testserver

package
v0.11.6 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewExecutableSchema

func NewExecutableSchema(cfg Config) graphql.ExecutableSchema

NewExecutableSchema creates an ExecutableSchema from the ResolverRoot interface.

Types

type Circle

type Circle struct {
	Radius float64
}

func (*Circle) Area

func (c *Circle) Area() float64

type ComplexityRoot added in v0.5.0

type ComplexityRoot struct {
	Circle struct {
		Radius func(childComplexity int) int
		Area   func(childComplexity int) int
	}

	EmbeddedPointer struct {
		Id    func(childComplexity int) int
		Title func(childComplexity int) int
	}

	Error struct {
		Id                      func(childComplexity int) int
		ErrorOnNonRequiredField func(childComplexity int) int
		ErrorOnRequiredField    func(childComplexity int) int
		NilOnRequiredField      func(childComplexity int) int
	}

	ForcedResolver struct {
		Field func(childComplexity int) int
	}

	InnerObject struct {
		Id func(childComplexity int) int
	}

	InvalidIdentifier struct {
		Id func(childComplexity int) int
	}

	It struct {
		Id func(childComplexity int) int
	}

	ModelMethods struct {
		ResolverField func(childComplexity int) int
		NoContext     func(childComplexity int) int
		WithContext   func(childComplexity int) int
	}

	OuterObject struct {
		Inner func(childComplexity int) int
	}

	Query struct {
		InvalidIdentifier func(childComplexity int) int
		Collision         func(childComplexity int) int
		MapInput          func(childComplexity int, input *map[string]interface{}) int
		Recursive         func(childComplexity int, input *RecursiveInputSlice) int
		NestedInputs      func(childComplexity int, input [][]*OuterInput) int
		NestedOutputs     func(childComplexity int) int
		Keywords          func(childComplexity int, input *Keywords) int
		Shapes            func(childComplexity int) int
		ErrorBubble       func(childComplexity int) int
		ModelMethods      func(childComplexity int) int
		Valid             func(childComplexity int) int
		User              func(childComplexity int, id int) int
		NullableArg       func(childComplexity int, arg *int) int
		KeywordArgs       func(childComplexity int, breakArg string, defaultArg string, funcArg string, interfaceArg string, selectArg string, caseArg string, deferArg string, goArg string, mapArg string, structArg string, chanArg string, elseArg string, gotoArg string, packageArg string, switchArg string, constArg string, fallthroughArg string, ifArg string, rangeArg string, typeArg string, continueArg string, forArg string, importArg string, returnArg string, varArg string) int
	}

	Rectangle struct {
		Length func(childComplexity int) int
		Width  func(childComplexity int) int
		Area   func(childComplexity int) int
	}

	Subscription struct {
		Updated     func(childComplexity int) int
		InitPayload func(childComplexity int) int
	}

	User struct {
		Id      func(childComplexity int) int
		Friends func(childComplexity int) int
	}
}

type Config

type Config struct {
	Resolvers  ResolverRoot
	Directives DirectiveRoot
	Complexity ComplexityRoot
}

type DirectiveRoot

type DirectiveRoot struct {
}

type EmbeddedPointer added in v0.6.0

type EmbeddedPointer struct {
	Title string
}

type EmbeddedPointerModel added in v0.6.0

type EmbeddedPointerModel struct {
	*EmbeddedPointer
	ID string
}

type Error added in v0.5.0

type Error struct {
	ID string
}

func (Error) ErrorOnNonRequiredField added in v0.5.0

func (Error) ErrorOnNonRequiredField() (string, error)

func (Error) ErrorOnRequiredField added in v0.5.0

func (Error) ErrorOnRequiredField() (string, error)

func (Error) NilOnRequiredField added in v0.5.0

func (Error) NilOnRequiredField() *string

type ForcedResolver

type ForcedResolver struct {
	Field Circle
}

type ForcedResolverResolver

type ForcedResolverResolver interface {
	Field(ctx context.Context, obj *ForcedResolver) (*Circle, error)
}

type InnerInput

type InnerInput struct {
	ID int `json:"id"`
}

func UnmarshalInnerInput

func UnmarshalInnerInput(v interface{}) (InnerInput, error)

type InnerObject

type InnerObject struct {
	ID int `json:"id"`
}

type Keywords

type Keywords struct {
	Break       string `json:"break"`
	Default     string `json:"default"`
	Func        string `json:"func"`
	Interface   string `json:"interface"`
	Select      string `json:"select"`
	Case        string `json:"case"`
	Defer       string `json:"defer"`
	Go          string `json:"go"`
	Map         string `json:"map"`
	Struct      string `json:"struct"`
	Chan        string `json:"chan"`
	Else        string `json:"else"`
	Goto        string `json:"goto"`
	Package     string `json:"package"`
	Switch      string `json:"switch"`
	Const       string `json:"const"`
	Fallthrough string `json:"fallthrough"`
	If          string `json:"if"`
	Range       string `json:"range"`
	Type        string `json:"type"`
	Continue    string `json:"continue"`
	For         string `json:"for"`
	Import      string `json:"import"`
	Return      string `json:"return"`
	Var         string `json:"var"`
}

func UnmarshalKeywords

func UnmarshalKeywords(v interface{}) (Keywords, error)

type ModelMethods added in v0.7.0

type ModelMethods struct {
}

func (ModelMethods) NoContext added in v0.7.0

func (m ModelMethods) NoContext() bool

func (ModelMethods) WithContext added in v0.7.0

func (m ModelMethods) WithContext(_ context.Context) bool

type ModelMethodsResolver added in v0.7.0

type ModelMethodsResolver interface {
	ResolverField(ctx context.Context, obj *ModelMethods) (bool, error)
}

type OuterInput

type OuterInput struct {
	Inner InnerInput `json:"inner"`
}

func UnmarshalOuterInput

func UnmarshalOuterInput(v interface{}) (OuterInput, error)

type OuterObject

type OuterObject struct {
	Inner InnerObject `json:"inner"`
}

type QueryResolver

type QueryResolver interface {
	InvalidIdentifier(ctx context.Context) (*invalid_packagename.InvalidIdentifier, error)
	Collision(ctx context.Context) (*introspection1.It, error)
	MapInput(ctx context.Context, input *map[string]interface{}) (*bool, error)
	Recursive(ctx context.Context, input *RecursiveInputSlice) (*bool, error)
	NestedInputs(ctx context.Context, input [][]*OuterInput) (*bool, error)
	NestedOutputs(ctx context.Context) ([][]*OuterObject, error)
	Keywords(ctx context.Context, input *Keywords) (bool, error)
	Shapes(ctx context.Context) ([]*Shape, error)
	ErrorBubble(ctx context.Context) (*Error, error)
	ModelMethods(ctx context.Context) (*ModelMethods, error)
	Valid(ctx context.Context) (string, error)
	User(ctx context.Context, id int) (User, error)
	NullableArg(ctx context.Context, arg *int) (*string, error)
	KeywordArgs(ctx context.Context, breakArg string, defaultArg string, funcArg string, interfaceArg string, selectArg string, caseArg string, deferArg string, goArg string, mapArg string, structArg string, chanArg string, elseArg string, gotoArg string, packageArg string, switchArg string, constArg string, fallthroughArg string, ifArg string, rangeArg string, typeArg string, continueArg string, forArg string, importArg string, returnArg string, varArg string) (bool, error)
}

type Rectangle

type Rectangle struct {
	Length, Width float64
}

func (*Rectangle) Area

func (r *Rectangle) Area() float64

type RecursiveInputSlice

type RecursiveInputSlice struct {
	Self []RecursiveInputSlice
}

func UnmarshalRecursiveInputSlice

func UnmarshalRecursiveInputSlice(v interface{}) (RecursiveInputSlice, error)

type Resolver

type Resolver struct{}

func (*Resolver) ForcedResolver

func (r *Resolver) ForcedResolver() ForcedResolverResolver

func (*Resolver) ModelMethods added in v0.7.0

func (r *Resolver) ModelMethods() ModelMethodsResolver

func (*Resolver) Query

func (r *Resolver) Query() QueryResolver

func (*Resolver) Subscription added in v0.5.1

func (r *Resolver) Subscription() SubscriptionResolver

func (*Resolver) User added in v0.6.0

func (r *Resolver) User() UserResolver

type ResolverRoot

type ResolverRoot interface {
	ForcedResolver() ForcedResolverResolver
	ModelMethods() ModelMethodsResolver
	Query() QueryResolver
	Subscription() SubscriptionResolver
	User() UserResolver
}

type Shape

type Shape interface {
	Area() float64
	// contains filtered or unexported methods
}

type ShapeUnion

type ShapeUnion interface {
	Area() float64
	// contains filtered or unexported methods
}

type SubscriptionResolver added in v0.5.1

type SubscriptionResolver interface {
	Updated(ctx context.Context) (<-chan string, error)
	InitPayload(ctx context.Context) (<-chan string, error)
}

type User added in v0.6.0

type User struct {
	ID      int    `json:"id"`
	Friends []User `json:"friends"`
}

type UserResolver added in v0.6.0

type UserResolver interface {
	Friends(ctx context.Context, obj *User) ([]User, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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