wwgraphql

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: May 11, 2023 License: MIT Imports: 18 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 GqlGetNestedSubFields added in v0.7.1

func GqlGetNestedSubFields(ctx context.Context, fields []graphql.CollectedField, targetFields ...string) ([]graphql.CollectedField, bool)

GqlGetNestedSubFields will return the nested target field if found.

func GqlGetSubFields added in v0.7.1

func GqlGetSubFields(ctx context.Context, fields []graphql.CollectedField, targetField string) ([]graphql.CollectedField, bool)

GqlGetSubFields will return the target field if found.

func GqlHasFields added in v0.7.1

func GqlHasFields(fields []graphql.CollectedField, targetFields ...string) bool

GqlHasFields will return true if any of the target fields exist.

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 ValidateIntDirective added in v0.7.2

func ValidateIntDirective(ctx context.Context, obj interface{}, next graphql.Resolver, rules ValidateIntRules) (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 ValidateIntRules added in v0.7.2

type ValidateIntRules struct {
	Min *int `json:"min"`
	Max *int `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