graphql_models

package
v0.0.0-...-4e6cce8 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func NewExecutableSchema

func NewExecutableSchema(cfg Config) graphql.ExecutableSchema

NewExecutableSchema creates an ExecutableSchema from the ResolverRoot interface.

Types

type BooleanFilter

type BooleanFilter struct {
	EqualTo    *bool `json:"equalTo"`
	NotEqualTo *bool `json:"notEqualTo"`
}

type ComplexityRoot

type ComplexityRoot struct {
	PageInfo struct {
		EndCursor       func(childComplexity int) int
		HasNextPage     func(childComplexity int) int
		HasPreviousPage func(childComplexity int) int
		StartCursor     func(childComplexity int) int
	}

	Query struct {
		Node  func(childComplexity int, id string) int
		User  func(childComplexity int, id string) int
		Users func(childComplexity int, first int, after *string, ordering []*UserOrdering, filter *UserFilter) int
	}

	User struct {
		Age       func(childComplexity int) int
		Email     func(childComplexity int) int
		FirstName func(childComplexity int) int
		ID        func(childComplexity int) int
		LastName  func(childComplexity int) int
	}

	UserConnection struct {
		Edges    func(childComplexity int) int
		PageInfo func(childComplexity int) int
	}

	UserEdge struct {
		Cursor func(childComplexity int) int
		Node   func(childComplexity int) int
	}
}

type Config

type Config struct {
	Resolvers  ResolverRoot
	Directives DirectiveRoot
	Complexity ComplexityRoot
}

type DirectiveRoot

type DirectiveRoot struct {
}

type FloatFilter

type FloatFilter struct {
	EqualTo           *float64  `json:"equalTo"`
	NotEqualTo        *float64  `json:"notEqualTo"`
	LessThan          *float64  `json:"lessThan"`
	LessThanOrEqualTo *float64  `json:"lessThanOrEqualTo"`
	MoreThan          *float64  `json:"moreThan"`
	MoreThanOrEqualTo *float64  `json:"moreThanOrEqualTo"`
	In                []float64 `json:"in"`
	NotIn             []float64 `json:"notIn"`
}

type IDFilter

type IDFilter struct {
	EqualTo    *string  `json:"equalTo"`
	NotEqualTo *string  `json:"notEqualTo"`
	In         []string `json:"in"`
	NotIn      []string `json:"notIn"`
}

type IntFilter

type IntFilter struct {
	EqualTo           *int  `json:"equalTo"`
	NotEqualTo        *int  `json:"notEqualTo"`
	LessThan          *int  `json:"lessThan"`
	LessThanOrEqualTo *int  `json:"lessThanOrEqualTo"`
	MoreThan          *int  `json:"moreThan"`
	MoreThanOrEqualTo *int  `json:"moreThanOrEqualTo"`
	In                []int `json:"in"`
	NotIn             []int `json:"notIn"`
}

type Node

type Node interface {
	IsNode()
}

type PageInfo

type PageInfo struct {
	HasNextPage     bool    `json:"hasNextPage"`
	HasPreviousPage bool    `json:"hasPreviousPage"`
	StartCursor     *string `json:"startCursor"`
	EndCursor       *string `json:"endCursor"`
}

type QueryResolver

type QueryResolver interface {
	Node(ctx context.Context, id string) (Node, error)
	User(ctx context.Context, id string) (*User, error)
	Users(ctx context.Context, first int, after *string, ordering []*UserOrdering, filter *UserFilter) (*UserConnection, error)
}

type ResolverRoot

type ResolverRoot interface {
	Query() QueryResolver
}

type StringFilter

type StringFilter struct {
	EqualTo            *string  `json:"equalTo"`
	NotEqualTo         *string  `json:"notEqualTo"`
	In                 []string `json:"in"`
	NotIn              []string `json:"notIn"`
	StartWith          *string  `json:"startWith"`
	NotStartWith       *string  `json:"notStartWith"`
	EndWith            *string  `json:"endWith"`
	NotEndWith         *string  `json:"notEndWith"`
	Contain            *string  `json:"contain"`
	NotContain         *string  `json:"notContain"`
	StartWithStrict    *string  `json:"startWithStrict"`
	NotStartWithStrict *string  `json:"notStartWithStrict"`
	EndWithStrict      *string  `json:"endWithStrict"`
	NotEndWithStrict   *string  `json:"notEndWithStrict"`
	ContainStrict      *string  `json:"containStrict"`
	NotContainStrict   *string  `json:"notContainStrict"`
}

type User

type User struct {
	ID        string  `json:"id"`
	FirstName string  `json:"firstName"`
	LastName  string  `json:"lastName"`
	Age       int     `json:"age"`
	Email     *string `json:"email"`
}

func (User) IsNode

func (User) IsNode()

type UserConnection

type UserConnection struct {
	Edges    []*UserEdge `json:"edges"`
	PageInfo *PageInfo   `json:"pageInfo"`
}

type UserEdge

type UserEdge struct {
	Cursor string `json:"cursor"`
	Node   *User  `json:"node"`
}

type UserFilter

type UserFilter struct {
	Search *string    `json:"search"`
	Where  *UserWhere `json:"where"`
}

type UserOrdering

type UserOrdering struct {
	Sort      UserSort                `json:"sort"`
	Direction boilergql.SortDirection `json:"direction"`
}

type UserSort

type UserSort string
const (
	UserSortID        UserSort = "ID"
	UserSortFirstName UserSort = "FIRST_NAME"
	UserSortLastName  UserSort = "LAST_NAME"
	UserSortAge       UserSort = "AGE"
	UserSortEmail     UserSort = "EMAIL"
)

func (UserSort) IsValid

func (e UserSort) IsValid() bool

func (UserSort) MarshalGQL

func (e UserSort) MarshalGQL(w io.Writer)

func (UserSort) String

func (e UserSort) String() string

func (*UserSort) UnmarshalGQL

func (e *UserSort) UnmarshalGQL(v interface{}) error

type UserWhere

type UserWhere struct {
	ID        *IDFilter     `json:"id"`
	FirstName *StringFilter `json:"firstName"`
	LastName  *StringFilter `json:"lastName"`
	Age       *IntFilter    `json:"age"`
	Email     *StringFilter `json:"email"`
	Or        *UserWhere    `json:"or"`
	And       *UserWhere    `json:"and"`
}

Jump to

Keyboard shortcuts

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