gqlgen

package
v0.0.0-...-718afa2 Latest Latest
Warning

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

Go to latest
Published: May 19, 2024 License: AGPL-3.0 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 AlbumResolver

type AlbumResolver interface {
	Artist(ctx context.Context, obj *types.Album) (*types.Artist, error)
	Songs(ctx context.Context, obj *types.Album) ([]*types.Song, error)
}

type ArtistResolver

type ArtistResolver interface {
	Albums(ctx context.Context, obj *types.Artist) ([]*types.Album, error)
	RelatedArtists(ctx context.Context, obj *types.Artist) ([]*types.Artist, error)
}

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
}

type SongResolver

type SongResolver interface {
	Artist(ctx context.Context, obj *types.Song) (*types.Artist, error)
	Album(ctx context.Context, obj *types.Song) (*types.Album, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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