mockschema

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2019 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MarshalDateTime

func MarshalDateTime(d time.Time) graphql.Marshaler

func New

func NewExecutableSchema

func NewExecutableSchema(cfg Config) graphql.ExecutableSchema

NewExecutableSchema creates an ExecutableSchema from the ResolverRoot interface.

func UnmarshalDateTime

func UnmarshalDateTime(v interface{}) (time.Time, error)

Types

type ComplexityRoot

type ComplexityRoot struct {
	MeResponse struct {
		Tid  func(childComplexity int) int
		User func(childComplexity int) int
	}

	MockEntity struct {
		Id       func(childComplexity int) int
		String   func(childComplexity int) int
		Integer  func(childComplexity int) int
		Float    func(childComplexity int) int
		Boolean  func(childComplexity int) int
		DateTime func(childComplexity int) int
		Object   func(childComplexity int) int
	}

	MockEntityResponse struct {
		Tid    func(childComplexity int) int
		Entity func(childComplexity int) int
	}

	Query struct {
		Me         func(childComplexity int) int
		MockEntity 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 MeResponse

type MeResponse struct {
	Tid  string `json:"tid"`
	User User   `json:"user"`
}

type MockEntity

type MockEntity struct {
	ID       string    `json:"id"`
	String   string    `json:"string"`
	Integer  int       `json:"integer"`
	Float    float64   `json:"float"`
	Boolean  bool      `json:"boolean"`
	DateTime time.Time `json:"dateTime"`
	Object   Object    `json:"object"`
}

type MockEntityResponse

type MockEntityResponse struct {
	Tid    string     `json:"tid"`
	Entity MockEntity `json:"entity"`
}

type Object

type Object map[string]interface{}

func (Object) MarshalGQL

func (j Object) MarshalGQL(w io.Writer)

MarshalGQL implements the graphql.Marshaler interface

func (*Object) UnmarshalGQL

func (j *Object) UnmarshalGQL(v interface{}) error

UnmarshalGQL implements the graphql.Marshaler interface

type QueryResolver

type QueryResolver interface {
	Me(ctx context.Context) (MeResponse, error)
	MockEntity(ctx context.Context) (MockEntityResponse, error)
}

type Resolver

type Resolver struct{}

func NewResolver

func NewResolver() *Resolver

func (*Resolver) Query

func (r *Resolver) Query() QueryResolver

type ResolverRoot

type ResolverRoot interface {
	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