Documentation ¶
Index ¶
- Variables
- func NewExecutableSchema(cfg Config) graphql.ExecutableSchema
- func RunServer() *httptest.Server
- type Animal
- type Being
- type BeingsHair
- type ComplexityRoot
- type Config
- type DirectiveRoot
- type Hair
- type Lucky
- type MutationResolver
- type NewUser
- type QueryResolver
- type ResolverRoot
- type Species
- type User
Constants ¶
This section is empty.
Variables ¶
View Source
var AllSpecies = []Species{ SpeciesDog, SpeciesCoelacanth, }
Functions ¶
func NewExecutableSchema ¶
func NewExecutableSchema(cfg Config) graphql.ExecutableSchema
NewExecutableSchema creates an ExecutableSchema from the ResolverRoot interface.
Types ¶
type Animal ¶
type Animal struct { ID string `json:"id"` Name string `json:"name"` Species Species `json:"species"` Owner Being `json:"owner,omitempty"` Hair *BeingsHair `json:"hair,omitempty"` }
type BeingsHair ¶
type BeingsHair struct {
HasHair bool `json:"hasHair"`
}
type ComplexityRoot ¶
type ComplexityRoot struct { Animal struct { Hair func(childComplexity int) int ID func(childComplexity int) int Name func(childComplexity int) int Owner func(childComplexity int) int Species func(childComplexity int) int } BeingsHair struct { HasHair func(childComplexity int) int } Hair struct { Color func(childComplexity int) int } Mutation struct { CreateUser func(childComplexity int, input NewUser) int } Query struct { Being func(childComplexity int, id string) int Beings func(childComplexity int, ids []string) int Fail func(childComplexity int) int LotteryWinner func(childComplexity int, number int) int Me func(childComplexity int) int User func(childComplexity int, id *string) int UserSearch func(childComplexity int, birthdate *string, id *string) int UsersBornOn func(childComplexity int, date string) int UsersBornOnDates func(childComplexity int, dates []string) int } User struct { Birthdate func(childComplexity int) int Friends func(childComplexity int) int Hair func(childComplexity int) int ID func(childComplexity int) int LuckyNumber func(childComplexity int) int Name func(childComplexity int) int } }
type Config ¶
type Config struct { Resolvers ResolverRoot Directives DirectiveRoot Complexity ComplexityRoot }
type DirectiveRoot ¶
type DirectiveRoot struct { }
type MutationResolver ¶
type QueryResolver ¶
type QueryResolver interface { Me(ctx context.Context) (*User, error) User(ctx context.Context, id *string) (*User, error) Being(ctx context.Context, id string) (Being, error) Beings(ctx context.Context, ids []string) ([]Being, error) LotteryWinner(ctx context.Context, number int) (Lucky, error) UsersBornOn(ctx context.Context, date string) ([]*User, error) UsersBornOnDates(ctx context.Context, dates []string) ([]*User, error) UserSearch(ctx context.Context, birthdate *string, id *string) ([]*User, error) Fail(ctx context.Context) (*bool, error) }
type ResolverRoot ¶
type ResolverRoot interface { Mutation() MutationResolver Query() QueryResolver }
Click to show internal directories.
Click to hide internal directories.