graph

package
v0.0.0-...-808094b Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2024 License: Apache-2.0 Imports: 23 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.

func NewServer

func NewServer(cnf config.Graphql, app app.App) server.Server

Types

type ComplexityRoot

type ComplexityRoot struct {
	GenreListDto struct {
		ID   func(childComplexity int) int
		Name func(childComplexity int) int
	}

	Mutation struct {
		CreateGenre        func(childComplexity int, input model.CreateGenreInput) int
		CreateSong         func(childComplexity int, input model.CreateSongInput) int
		CreateUser         func(childComplexity int, input model.CreateUserInput) int
		DeleteGenre        func(childComplexity int, id uuid.UUID) int
		DeleteSong         func(childComplexity int, id uuid.UUID) int
		MarkSongAsListened func(childComplexity int, userID uuid.UUID, songID uuid.UUID) int
	}

	Query struct {
		Genre               func(childComplexity int, id uuid.UUID) int
		Genres              func(childComplexity int) int
		Song                func(childComplexity int, id uuid.UUID) int
		Songs               func(childComplexity int) int
		SongsByGenre        func(childComplexity int, genreID uuid.UUID) int
		SongsRecommendation func(childComplexity int, userID uuid.UUID) int
		User                func(childComplexity int, email string) int
	}

	SongListDto struct {
		Artist func(childComplexity int) int
		ID     func(childComplexity int) int
		Title  func(childComplexity int) int
	}

	UserListDto struct {
		Email    func(childComplexity int) int
		ID       func(childComplexity int) int
		UserName func(childComplexity int) int
	}
}

type Config

type Config struct {
	Schema     *ast.Schema
	Resolvers  ResolverRoot
	Directives DirectiveRoot
	Complexity ComplexityRoot
}

type DirectiveRoot

type DirectiveRoot struct {
}

type MutationResolver

type MutationResolver interface {
	CreateUser(ctx context.Context, input model.CreateUserInput) (*model.UserListDto, error)
	CreateGenre(ctx context.Context, input model.CreateGenreInput) (*model.GenreListDto, error)
	DeleteGenre(ctx context.Context, id uuid.UUID) (bool, error)
	CreateSong(ctx context.Context, input model.CreateSongInput) (*model.SongListDto, error)
	DeleteSong(ctx context.Context, id uuid.UUID) (bool, error)
	MarkSongAsListened(ctx context.Context, userID uuid.UUID, songID uuid.UUID) (bool, error)
}

type QueryResolver

type QueryResolver interface {
	User(ctx context.Context, email string) (*model.UserListDto, error)
	Genres(ctx context.Context) ([]*model.GenreListDto, error)
	Genre(ctx context.Context, id uuid.UUID) (*model.GenreListDto, error)
	Songs(ctx context.Context) ([]*model.SongListDto, error)
	Song(ctx context.Context, id uuid.UUID) (*model.SongListDto, error)
	SongsByGenre(ctx context.Context, genreID uuid.UUID) ([]*model.SongListDto, error)
	SongsRecommendation(ctx context.Context, userID uuid.UUID) ([]*model.SongListDto, error)
}

type Resolver

type Resolver struct {
	// contains filtered or unexported fields
}

func (*Resolver) Mutation

func (r *Resolver) Mutation() MutationResolver

Mutation returns MutationResolver implementation.

func (*Resolver) Query

func (r *Resolver) Query() QueryResolver

Query returns QueryResolver implementation.

type ResolverRoot

type ResolverRoot interface {
	Mutation() MutationResolver
	Query() QueryResolver
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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