graphql

package
v0.0.0-...-b5ea6c6 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2019 License: AGPL-3.0 Imports: 22 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 ComplexityRoot

type ComplexityRoot struct {
	Mutation struct {
		ChangePassword func(childComplexity int, password string) int
		Login          func(childComplexity int, email string, password string) int
		RegisterUser   func(childComplexity int, email string, password string) int
		RemovePanda    func(childComplexity int, id string) int
		TagPanda       func(childComplexity int, id string, tags []string) int
		UploadPanda    func(childComplexity int, file graphql.Upload, tags []string) int
	}

	PandaFile struct {
		Created  func(childComplexity int) int
		FileName func(childComplexity int) int
		FileSize func(childComplexity int) int
		FileType func(childComplexity int) int
		ID       func(childComplexity int) int
		Modified func(childComplexity int) int
		Tags     func(childComplexity int) int
		URL      func(childComplexity int) int
	}

	Query struct {
		Me     func(childComplexity int) int
		Panda  func(childComplexity int, id string) int
		Pandas func(childComplexity int, tags []string) int
	}

	Subscription struct {
		PandaAdded   func(childComplexity int) int
		PandaRemoved func(childComplexity int) int
	}

	User struct {
		Email func(childComplexity int) int
	}
}

type Config

type Config struct {
	Resolvers  ResolverRoot
	Directives DirectiveRoot
	Complexity ComplexityRoot
}

type DirectiveRoot

type DirectiveRoot struct {
}

type MutationResolver

type MutationResolver interface {
	UploadPanda(ctx context.Context, file graphql.Upload, tags []string) (*models.PandaFile, error)
	RemovePanda(ctx context.Context, id string) (bool, error)
	TagPanda(ctx context.Context, id string, tags []string) (*models.PandaFile, error)
	RegisterUser(ctx context.Context, email string, password string) (bool, error)
	Login(ctx context.Context, email string, password string) (string, error)
	ChangePassword(ctx context.Context, password string) (bool, error)
}

type PandaFileResolver

type PandaFileResolver interface {
	URL(ctx context.Context, obj *models.PandaFile) (string, error)
	Tags(ctx context.Context, obj *models.PandaFile) ([]string, error)
	Created(ctx context.Context, obj *models.PandaFile) (*time.Time, error)
	Modified(ctx context.Context, obj *models.PandaFile) (*time.Time, error)
}

type QueryResolver

type QueryResolver interface {
	Pandas(ctx context.Context, tags []string) ([]*models.PandaFile, error)
	Panda(ctx context.Context, id string) (*models.PandaFile, error)
	Me(ctx context.Context) (*models.User, error)
}

type Resolver

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

func (*Resolver) Mutation

func (r *Resolver) Mutation() MutationResolver

func (*Resolver) PandaFile

func (r *Resolver) PandaFile() PandaFileResolver

func (*Resolver) Query

func (r *Resolver) Query() QueryResolver

func (*Resolver) Subscription

func (r *Resolver) Subscription() SubscriptionResolver

type ResolverRoot

type ResolverRoot interface {
	Mutation() MutationResolver
	PandaFile() PandaFileResolver
	Query() QueryResolver
	Subscription() SubscriptionResolver
}

type SubscriptionResolver

type SubscriptionResolver interface {
	PandaAdded(ctx context.Context) (<-chan *models.PandaFile, error)
	PandaRemoved(ctx context.Context) (<-chan string, error)
}

Jump to

Keyboard shortcuts

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