accounts

package
v0.0.0-...-9fab475 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2021 License: MIT 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 {
	Entity struct {
		FindProductByUpc func(childComplexity int, upc string) int
		FindReviewByID   func(childComplexity int, id string) int
		FindUserByID     func(childComplexity int, id string) int
	}

	Product struct {
		Reviews func(childComplexity int) int
		Upc     func(childComplexity int) int
	}

	Query struct {
		// contains filtered or unexported fields
	}

	Review struct {
		Author  func(childComplexity int) int
		Body    func(childComplexity int) int
		ID      func(childComplexity int) int
		Product func(childComplexity int) int
	}

	User struct {
		ID       func(childComplexity int) int
		Reviews  func(childComplexity int) int
		Username func(childComplexity int) int
	}

	Service struct {
		SDL func(childComplexity int) int
	}
}

type Config

type Config struct {
	Resolvers  ResolverRoot
	Directives DirectiveRoot
	Complexity ComplexityRoot
}

type DirectiveRoot

type DirectiveRoot struct {
}

type EntityResolver

type EntityResolver interface {
	FindProductByUpc(ctx context.Context, upc string) (*Product, error)
	FindReviewByID(ctx context.Context, id string) (*Review, error)
	FindUserByID(ctx context.Context, id string) (*User, error)
}

type Product

type Product struct {
	Upc     string    `json:"upc"`
	Reviews []*Review `json:"reviews"`
}

func (Product) IsEntity

func (Product) IsEntity()

type ProductResolver

type ProductResolver interface {
	Reviews(ctx context.Context, obj *Product) ([]*Review, error)
}

type ResolverRoot

type ResolverRoot interface {
	Entity() EntityResolver
	Product() ProductResolver
	Review() ReviewResolver
	User() UserResolver
}

func NewResolver

func NewResolver() ResolverRoot

type Review

type Review struct {
	ID         string `json:"id"`
	AuthorID   string `json:"authorID"`
	ProductUPC string `json:"productUPC"`
	Body       string `json:"body"`
}

func (Review) IsEntity

func (Review) IsEntity()

type ReviewResolver

type ReviewResolver interface {
	Author(ctx context.Context, obj *Review) (*User, error)
	Product(ctx context.Context, obj *Review) (*Product, error)
}

type User

type User struct {
	ID       string    `json:"id"`
	Username *string   `json:"username"`
	Reviews  []*Review `json:"reviews"`
}

func (User) IsEntity

func (User) IsEntity()

type UserResolver

type UserResolver interface {
	Reviews(ctx context.Context, obj *User) ([]*Review, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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