Documentation ¶
Index ¶
- Constants
- func NewExecutableSchema(cfg Config) graphql.ExecutableSchema
- type ComplexityRoot
- type Config
- type DirectiveRoot
- type DistinguishingFeature
- type DistinguishingFeatureInput
- type Dog
- type DogInput
- type Header
- type Human
- type HumanInput
- type MutationResolver
- type QueryResolver
- type Resolver
- func (r *Resolver) CreateDog(ctx context.Context, humanID string, in DogInput) (*Dog, error)
- func (r *Resolver) CreateHuman(ctx context.Context, in HumanInput) (*Human, error)
- func (r *Resolver) Dog(ctx context.Context, id string) (*Dog, error)
- func (r *Resolver) Dogs(ctx context.Context) ([]*Dog, error)
- func (r *Resolver) ErrorsMutation(ctx context.Context) (string, error)
- func (r *Resolver) ErrorsQuery(ctx context.Context) (string, error)
- func (r *Resolver) HeadersMutation(ctx context.Context) ([]*Header, error)
- func (r *Resolver) HeadersQuery(ctx context.Context) ([]*Header, error)
- func (r *Resolver) Human(ctx context.Context, id string) (*Human, error)
- func (r *Resolver) Humans(ctx context.Context) ([]*Human, error)
- func (r *Resolver) Mutation() MutationResolver
- func (r *Resolver) Query() QueryResolver
- func (r *Resolver) ResetData()
- type ResolverRoot
Constants ¶
View Source
const (
HeadersContextKey = "Headers"
)
Variables ¶
This section is empty.
Functions ¶
func NewExecutableSchema ¶
func NewExecutableSchema(cfg Config) graphql.ExecutableSchema
NewExecutableSchema creates an ExecutableSchema from the ResolverRoot interface.
Types ¶
type ComplexityRoot ¶
type ComplexityRoot struct { DistinguishingFeature struct { Description func(childComplexity int) int SpottingDifficulty func(childComplexity int) int } Dog struct { DistinguishingFeatures func(childComplexity int) int ID func(childComplexity int) int Name func(childComplexity int) int OwnerID func(childComplexity int) int TailLength func(childComplexity int) int } Header struct { Name func(childComplexity int) int Values func(childComplexity int) int } Human struct { Dogs func(childComplexity int) int ID func(childComplexity int) int Name func(childComplexity int) int } Mutation struct { CreateDog func(childComplexity int, humanID string, in DogInput) int CreateHuman func(childComplexity int, in HumanInput) int ErrorsMutation func(childComplexity int) int HeadersMutation func(childComplexity int) int } Query struct { Dog func(childComplexity int, id string) int Dogs func(childComplexity int) int ErrorsQuery func(childComplexity int) int HeadersQuery func(childComplexity int) int Human func(childComplexity int, id string) int Humans func(childComplexity int) int } }
type Config ¶
type Config struct { Resolvers ResolverRoot Directives DirectiveRoot Complexity ComplexityRoot }
type DirectiveRoot ¶
type DirectiveRoot struct { }
type DistinguishingFeature ¶
type Dog ¶
type Dog struct { ID string `json:"id"` Name string `json:"name"` OwnerID string `json:"ownerId"` TailLength *int `json:"tailLength"` DistinguishingFeatures []*DistinguishingFeature `json:"distinguishingFeatures"` }
type DogInput ¶
type DogInput struct { Name string `json:"name"` TailLength *int `json:"tailLength"` DistinguishingFeatures []*DistinguishingFeatureInput `json:"distinguishingFeatures"` }
type HumanInput ¶
type MutationResolver ¶
type QueryResolver ¶
type QueryResolver interface { Humans(ctx context.Context) ([]*Human, error) Human(ctx context.Context, id string) (*Human, error) Dogs(ctx context.Context) ([]*Dog, error) Dog(ctx context.Context, id string) (*Dog, error) HeadersQuery(ctx context.Context) ([]*Header, error) ErrorsQuery(ctx context.Context) (string, error) }
type Resolver ¶
func (*Resolver) CreateHuman ¶
func (*Resolver) ErrorsMutation ¶
func (*Resolver) HeadersMutation ¶
func (*Resolver) HeadersQuery ¶
func (*Resolver) Mutation ¶
func (r *Resolver) Mutation() MutationResolver
func (*Resolver) Query ¶
func (r *Resolver) Query() QueryResolver
type ResolverRoot ¶
type ResolverRoot interface { Mutation() MutationResolver Query() QueryResolver }
Click to show internal directories.
Click to hide internal directories.