Documentation ¶
Index ¶
- func NewExecutableSchema(cfg Config) graphql.ExecutableSchema
- type Character
- type CharacterFields
- type Config
- type DirectiveRoot
- type Droid
- type DroidResolver
- type Episode
- type FriendsConnection
- type FriendsConnectionResolver
- type FriendsEdge
- type Human
- type HumanResolver
- type LengthUnit
- type MutationResolver
- type PageInfo
- type QueryResolver
- type Resolver
- type ResolverRoot
- type Review
- type SearchResult
- type Starship
- type StarshipResolver
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 CharacterFields ¶
type Config ¶
type Config struct { Resolvers ResolverRoot Directives DirectiveRoot }
func NewResolver ¶
func NewResolver() Config
type DirectiveRoot ¶
type DirectiveRoot struct { }
type Droid ¶
type Droid struct { CharacterFields PrimaryFunction string }
type DroidResolver ¶
type FriendsConnection ¶
type FriendsConnection struct {
// contains filtered or unexported fields
}
func (*FriendsConnection) PageInfo ¶
func (f *FriendsConnection) PageInfo() PageInfo
func (*FriendsConnection) TotalCount ¶
func (f *FriendsConnection) TotalCount() int
type FriendsConnectionResolver ¶
type FriendsConnectionResolver interface { Edges(ctx context.Context, obj *FriendsConnection) ([]FriendsEdge, error) Friends(ctx context.Context, obj *FriendsConnection) ([]Character, error) }
type FriendsEdge ¶
type Human ¶
type Human struct { CharacterFields StarshipIds []string Mass float64 // contains filtered or unexported fields }
func (*Human) Height ¶
func (h *Human) Height(unit LengthUnit) float64
type HumanResolver ¶
type LengthUnit ¶
type LengthUnit string
const ( LengthUnitMeter LengthUnit = "METER" LengthUnitFoot LengthUnit = "FOOT" )
func (LengthUnit) IsValid ¶
func (e LengthUnit) IsValid() bool
func (LengthUnit) MarshalGQL ¶
func (e LengthUnit) MarshalGQL(w io.Writer)
func (LengthUnit) String ¶
func (e LengthUnit) String() string
func (*LengthUnit) UnmarshalGQL ¶
func (e *LengthUnit) UnmarshalGQL(v interface{}) error
type MutationResolver ¶
type QueryResolver ¶
type QueryResolver interface { Hero(ctx context.Context, episode Episode) (Character, error) Reviews(ctx context.Context, episode Episode, since *time.Time) ([]Review, error) Search(ctx context.Context, text string) ([]SearchResult, error) Character(ctx context.Context, id string) (Character, error) Droid(ctx context.Context, id string) (*Droid, error) Human(ctx context.Context, id string) (*Human, error) Starship(ctx context.Context, id string) (*Starship, error) }
type Resolver ¶
type Resolver struct {
// contains filtered or unexported fields
}
func (*Resolver) Droid ¶
func (r *Resolver) Droid() DroidResolver
func (*Resolver) FriendsConnection ¶
func (r *Resolver) FriendsConnection() FriendsConnectionResolver
func (*Resolver) Human ¶
func (r *Resolver) Human() HumanResolver
func (*Resolver) Mutation ¶
func (r *Resolver) Mutation() MutationResolver
func (*Resolver) Query ¶
func (r *Resolver) Query() QueryResolver
func (*Resolver) Starship ¶
func (r *Resolver) Starship() StarshipResolver
type ResolverRoot ¶
type ResolverRoot interface { Droid() DroidResolver FriendsConnection() FriendsConnectionResolver Human() HumanResolver Mutation() MutationResolver Query() QueryResolver Starship() StarshipResolver }
type Review ¶
func UnmarshalReviewInput ¶
type SearchResult ¶
type SearchResult interface{}
type StarshipResolver ¶
Click to show internal directories.
Click to hide internal directories.