gql

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2019 License: GPL-3.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const WireRegistryTypeBot = "wrn:registry-type:bot"

WireRegistryTypeBot => Bot.

Variables

This section is empty.

Functions

func NewExecutableSchema

func NewExecutableSchema(cfg Config) graphql.ExecutableSchema

NewExecutableSchema creates an ExecutableSchema from the ResolverRoot interface.

func Server

func Server(baseApp *bam.BaseApp, cdc *codec.Codec, keeper registry.Keeper, accountKeeper auth.AccountKeeper)

Server configures and starts the GQL server.

Types

type Account

type Account struct {
	Address  string  `json:"address"`
	PubKey   *string `json:"pubKey"`
	Number   BigUInt `json:"number"`
	Sequence BigUInt `json:"sequence"`
	Balance  []Coin  `json:"balance"`
}

type AccountResolver

type AccountResolver interface {
	Number(ctx context.Context, obj *Account) (string, error)
	Sequence(ctx context.Context, obj *Account) (string, error)
}

type BigUInt

type BigUInt uint64

BigUInt represents a 64-bit unsigned integer.

type Bot

type Bot struct {
	Record    *Record `json:"record"`
	Name      string  `json:"name"`
	AccessKey *string `json:"accessKey"`
}

type Coin

type Coin struct {
	Type   string  `json:"type"`
	Amount BigUInt `json:"amount"`
}

type CoinResolver

type CoinResolver interface {
	Amount(ctx context.Context, obj *Coin) (string, error)
}

type ComplexityRoot

type ComplexityRoot struct {
	Account struct {
		Address  func(childComplexity int) int
		PubKey   func(childComplexity int) int
		Number   func(childComplexity int) int
		Sequence func(childComplexity int) int
		Balance  func(childComplexity int) int
	}

	Bot struct {
		Record    func(childComplexity int) int
		Name      func(childComplexity int) int
		AccessKey func(childComplexity int) int
	}

	Coin struct {
		Type   func(childComplexity int) int
		Amount func(childComplexity int) int
	}

	KeyValue struct {
		Key   func(childComplexity int) int
		Value func(childComplexity int) int
	}

	Mutation struct {
		Submit func(childComplexity int, tx string) int
	}

	Query struct {
		GetAccounts            func(childComplexity int, addresses []string) int
		GetRecordsByIds        func(childComplexity int, ids []string) int
		GetRecordsByAttributes func(childComplexity int, attributes []*KeyValueInput) int
		GetBotsByAttributes    func(childComplexity int, attributes []*KeyValueInput) int
	}

	Record struct {
		ID         func(childComplexity int) int
		Type       func(childComplexity int) int
		Owner      func(childComplexity int) int
		Attributes func(childComplexity int) int
	}

	Value struct {
		Null    func(childComplexity int) int
		Int     func(childComplexity int) int
		Float   func(childComplexity int) int
		String  func(childComplexity int) int
		Boolean func(childComplexity int) int
		Values  func(childComplexity int) int
	}
}

type Config

type Config struct {
	Resolvers  ResolverRoot
	Directives DirectiveRoot
	Complexity ComplexityRoot
}

type DirectiveRoot

type DirectiveRoot struct {
}

type KeyValue

type KeyValue struct {
	Key   string `json:"key"`
	Value Value  `json:"value"`
}

type KeyValueInput

type KeyValueInput struct {
	Key   string     `json:"key"`
	Value ValueInput `json:"value"`
}

type MutationResolver

type MutationResolver interface {
	Submit(ctx context.Context, tx string) (*string, error)
}

type QueryResolver

type QueryResolver interface {
	GetAccounts(ctx context.Context, addresses []string) ([]*Account, error)
	GetRecordsByIds(ctx context.Context, ids []string) ([]*Record, error)
	GetRecordsByAttributes(ctx context.Context, attributes []*KeyValueInput) ([]*Record, error)
	GetBotsByAttributes(ctx context.Context, attributes []*KeyValueInput) ([]*Bot, error)
}

type Record

type Record struct {
	ID         string      `json:"id"`
	Type       string      `json:"type"`
	Owner      string      `json:"owner"`
	Attributes []*KeyValue `json:"attributes"`
}

type Resolver

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

Resolver is the GQL query resolver.

func (*Resolver) Account

func (r *Resolver) Account() AccountResolver

Account resolver.

func (*Resolver) Coin

func (r *Resolver) Coin() CoinResolver

Coin resolver.

func (*Resolver) Mutation

func (r *Resolver) Mutation() MutationResolver

Mutation is the entry point to tx execution.

func (*Resolver) Query

func (r *Resolver) Query() QueryResolver

Query is the entry point to query execution.

type ResolverRoot

type ResolverRoot interface {
	Account() AccountResolver
	Coin() CoinResolver
	Mutation() MutationResolver
	Query() QueryResolver
}

type Value

type Value struct {
	Null    *bool    `json:"null"`
	Int     *int     `json:"int"`
	Float   *float64 `json:"float"`
	String  *string  `json:"string"`
	Boolean *bool    `json:"boolean"`
	Values  []*Value `json:"values"`
}

type ValueInput

type ValueInput struct {
	Null    *bool         `json:"null"`
	Int     *int          `json:"int"`
	Float   *float64      `json:"float"`
	String  *string       `json:"string"`
	Boolean *bool         `json:"boolean"`
	Values  []*ValueInput `json:"values"`
}

Jump to

Keyboard shortcuts

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