graphql

package
v0.0.0-...-5f3117a Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2019 License: MIT Imports: 12 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 {
		AddUser func(childComplexity int, user UserInput) int
	}

	Person struct {
		Birthdate func(childComplexity int) int
		Email     func(childComplexity int) int
		Firstname func(childComplexity int) int
		ID        func(childComplexity int) int
		Lastname  func(childComplexity int) int
		Phone     func(childComplexity int) int
	}

	Query struct {
		GetUserByID func(childComplexity int, id *string) int
		GetUsers    func(childComplexity int) int
	}

	User struct {
		ID       func(childComplexity int) int
		Person   func(childComplexity int) int
		Username 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 {
	AddUser(ctx context.Context, user UserInput) (*user.User, error)
}

type PersonInput

type PersonInput struct {
	Firstname string    `json:"firstname"`
	Lastname  string    `json:"lastname"`
	Email     string    `json:"email"`
	Phone     string    `json:"phone"`
	Birthdate time.Time `json:"birthdate"`
}

type QueryResolver

type QueryResolver interface {
	GetUserByID(ctx context.Context, id *string) (*user.User, error)
	GetUsers(ctx context.Context) ([]*user.User, error)
}

type ResolverRoot

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

type UserInput

type UserInput struct {
	Username string       `json:"username"`
	Person   *PersonInput `json:"person"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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