generated

package
v0.0.0-...-92e2128 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2020 License: MIT Imports: 11 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 {
	Item struct {
		ID   func(childComplexity int) int
		Name func(childComplexity int) int
	}

	Mutation struct {
		Pay            func(childComplexity int, paymentItemID string) int
		UpdateUserName func(childComplexity int, name string) int
	}

	PaymentItem struct {
		Item     func(childComplexity int) int
		Price    func(childComplexity int) int
		Quantity func(childComplexity int) int
	}

	PaymentLog struct {
		CreatedAt func(childComplexity int) int
		Item      func(childComplexity int) int
	}

	PaymentLogs struct {
		Cursor func(childComplexity int) int
		Nodes  func(childComplexity int) int
	}

	Query struct {
		PaymentItems func(childComplexity int) int
		PaymentLogs  func(childComplexity int, cursor string) int
		Rankers      func(childComplexity int, offset int64, limit int64) int
		User         func(childComplexity int) int
	}

	Ranker struct {
		Rank  func(childComplexity int) int
		Score func(childComplexity int) int
		User  func(childComplexity int) int
	}

	User struct {
		ID   func(childComplexity int) int
		Name func(childComplexity int) int
	}
}

type Config

type Config struct {
	Resolvers  ResolverRoot
	Directives DirectiveRoot
	Complexity ComplexityRoot
}

type DirectiveRoot

type DirectiveRoot struct {
}

type Item

type Item struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

type MutationResolver

type MutationResolver interface {
	UpdateUserName(ctx context.Context, name string) (*User, error)
	Pay(ctx context.Context, paymentItemID string) (*PaymentLog, error)
}

type PaymentItem

type PaymentItem struct {
	Item     *Item `json:"item"`
	Price    int64 `json:"price"`
	Quantity int64 `json:"quantity"`
}

type PaymentLog

type PaymentLog struct {
	Item      *PaymentItem `json:"item"`
	CreatedAt time.Time    `json:"createdAt"`
}

type PaymentLogs

type PaymentLogs struct {
	Nodes  []*PaymentLog `json:"nodes"`
	Cursor string        `json:"cursor"`
}

type QueryResolver

type QueryResolver interface {
	User(ctx context.Context) (*User, error)
	Rankers(ctx context.Context, offset int64, limit int64) ([]*Ranker, error)
	PaymentItems(ctx context.Context) ([]*PaymentItem, error)
	PaymentLogs(ctx context.Context, cursor string) (*PaymentLogs, error)
}

type Ranker

type Ranker struct {
	User  *User `json:"user"`
	Rank  int64 `json:"rank"`
	Score int64 `json:"score"`
}

type ResolverRoot

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

type User

type User struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

Jump to

Keyboard shortcuts

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