wwgraphql

package
v0.5.5 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2021 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MB int64 = 1 << 20

Functions

func DefaultErrorPresenter added in v0.0.6

func DefaultErrorPresenter(log zerolog.Logger) func(ctx context.Context, e error) *gqlerror.Error

func NewGraphQlServer

func NewGraphQlServer(es graphql.ExecutableSchema, log zerolog.Logger, enableIntrospection bool) *handler.Server

func ValidateDateDirective added in v0.0.20

func ValidateDateDirective(ctx context.Context, obj interface{}, next graphql.Resolver, rules ValidateDateRules) (res interface{}, err error)

func ValidateDecimalDirective added in v0.5.2

func ValidateDecimalDirective(ctx context.Context, obj interface{}, next graphql.Resolver, rules ValidateDecimalRules) (res interface{}, err error)

func ValidateStringDirective

func ValidateStringDirective(ctx context.Context, obj interface{}, next graphql.Resolver, rules ValidateStringRules) (res interface{}, err error)

Types

type ValidateDateRelative added in v0.0.20

type ValidateDateRelative struct {
	Years  int `json:"years"`
	Months int `json:"months"`
	Days   int `json:"days"`
}

type ValidateDateRules added in v0.0.20

type ValidateDateRules struct {
	BeforeDate     *scalars.GqlDate      `json:"beforeDate"`
	BeforeRelative *ValidateDateRelative `json:"beforeRelative"`
	AfterDate      *scalars.GqlDate      `json:"afterDate"`
	AfterRelative  *ValidateDateRelative `json:"afterRelative"`
}

type ValidateDecimalRules added in v0.5.2

type ValidateDecimalRules struct {
	Min *decimal.Decimal `json:"min"`
	Max *decimal.Decimal `json:"max"`
}

type ValidateStringRules

type ValidateStringRules struct {
	MinLength *int    `json:"minLength"`
	MaxLength *int    `json:"maxLength"`
	Pattern   *string `json:"pattern"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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