graphql

package
v0.0.0-...-ccb75e7 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2019 License: Apache-2.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 ComplexityRoot

type ComplexityRoot struct {
	Mutation struct {
		CreateReview func(childComplexity int, review *ReviewInput) int
	}

	Query struct {
		Review func(childComplexity int, id int) int
	}

	Review struct {
		ArtID     func(childComplexity int) int
		ReviewID  func(childComplexity int) int
		Text      func(childComplexity int) int
		Timestamp func(childComplexity int) int
		Upvotes   func(childComplexity int) int
		UserID    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 {
	CreateReview(ctx context.Context, review *ReviewInput) (*Review, error)
}

type QueryResolver

type QueryResolver interface {
	Review(ctx context.Context, id int) (*Review, error)
}

type Resolver

type Resolver struct {
	KeyStore *keystore.KeyStore
}

Resolver is the resolver that handles graphql request

func (*Resolver) Mutation

func (r *Resolver) Mutation() MutationResolver

Mutation returns a query resolver

func (*Resolver) Query

func (r *Resolver) Query() QueryResolver

Query returns a query resolver

type ResolverRoot

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

type Review

type Review struct {
	ReviewID  int    `json:"reviewID"`
	UserID    int    `json:"userID"`
	ArtID     int    `json:"artID"`
	Text      string `json:"text"`
	Timestamp int    `json:"timestamp"`
	Upvotes   int    `json:"upvotes"`
}

type ReviewInput

type ReviewInput struct {
	UserID    int    `json:"userID"`
	ArtID     int    `json:"artID"`
	Text      string `json:"text"`
	Timestamp int    `json:"timestamp"`
	Upvotes   int    `json:"upvotes"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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