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 AlbumResolver ¶
type ArtistResolver ¶
type ComplexityRoot ¶
type ComplexityRoot struct { Album struct { Artist func(childComplexity int) int ID func(childComplexity int) int Name func(childComplexity int) int Songs func(childComplexity int) int Year func(childComplexity int) int } Artist struct { Albums func(childComplexity int) int ID func(childComplexity int) int Name func(childComplexity int) int RelatedArtists func(childComplexity int) int } Query struct { Album func(childComplexity int, id string) int Albums func(childComplexity int) int Artist func(childComplexity int, id string) int Artists func(childComplexity int) int Song func(childComplexity int, id string) int Songs func(childComplexity int) int } Song struct { Album func(childComplexity int) int Artist func(childComplexity int) int Chords func(childComplexity int) int ID func(childComplexity int) int Name func(childComplexity int) int TrackNum func(childComplexity int) int } }
type Config ¶
type Config struct { Schema *ast.Schema Resolvers ResolverRoot Directives DirectiveRoot Complexity ComplexityRoot }
type DirectiveRoot ¶
type DirectiveRoot struct { }
type QueryResolver ¶
type QueryResolver interface { Artists(ctx context.Context) ([]*types.Artist, error) Artist(ctx context.Context, id string) (*types.Artist, error) Albums(ctx context.Context) ([]*types.Album, error) Album(ctx context.Context, id string) (*types.Album, error) Songs(ctx context.Context) ([]*types.Song, error) Song(ctx context.Context, id string) (*types.Song, error) }
type Resolver ¶
type Resolver struct {
DB data.ChordsDBv1
}
Resolver is the base class embedded inside all the GraphQL resolvers.
func (*Resolver) Album ¶
func (r *Resolver) Album() AlbumResolver
Album returns AlbumResolver implementation.
func (*Resolver) Artist ¶
func (r *Resolver) Artist() ArtistResolver
Artist returns ArtistResolver implementation.
func (*Resolver) Query ¶
func (r *Resolver) Query() QueryResolver
Query returns QueryResolver implementation.
func (*Resolver) Song ¶
func (r *Resolver) Song() SongResolver
Song returns SongResolver implementation.
type ResolverRoot ¶
type ResolverRoot interface { Album() AlbumResolver Artist() ArtistResolver Query() QueryResolver Song() SongResolver }
Click to show internal directories.
Click to hide internal directories.