validation

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2019 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Description

type Description int

ENUM( NoDescription AnonymousOperationMustBeLonePerDocument ArgumentMustBeUnique ArgumentRequired DirectiveNotDefined DirectiveLocationInvalid DirectiveMustBeUniquePerLocation FieldNameOrAliasMismatch FieldSelectionsInvalid FragmentNotDefined FragmentSpreadCyclicReference FragmentDefinitionOnLeafNode FragmentRedeclared FragmentDeclaredButNeverUsed InputValueNotDefined OperationNameMustBeUnique RootTypeNotDefined SelectionSetInvalid SelectionSetResponseShapesCannotMerge SubscriptionsMustHaveMaxOneRootField TypeNotDefined ValueInvalid VariableMustBeUniquePerOperation VariableMustBeValidInputType VariableNotDefined VariableDefinedButNotUsed )

const (
	// NoDescription is a Description of type NoDescription
	NoDescription Description = iota
	// AnonymousOperationMustBeLonePerDocument is a Description of type AnonymousOperationMustBeLonePerDocument
	AnonymousOperationMustBeLonePerDocument
	// ArgumentMustBeUnique is a Description of type ArgumentMustBeUnique
	ArgumentMustBeUnique
	// ArgumentRequired is a Description of type ArgumentRequired
	ArgumentRequired
	// DirectiveNotDefined is a Description of type DirectiveNotDefined
	DirectiveNotDefined
	// DirectiveLocationInvalid is a Description of type DirectiveLocationInvalid
	DirectiveLocationInvalid
	// DirectiveMustBeUniquePerLocation is a Description of type DirectiveMustBeUniquePerLocation
	DirectiveMustBeUniquePerLocation
	// FieldNameOrAliasMismatch is a Description of type FieldNameOrAliasMismatch
	FieldNameOrAliasMismatch
	// FieldSelectionsInvalid is a Description of type FieldSelectionsInvalid
	FieldSelectionsInvalid
	// FragmentNotDefined is a Description of type FragmentNotDefined
	FragmentNotDefined
	// FragmentSpreadCyclicReference is a Description of type FragmentSpreadCyclicReference
	FragmentSpreadCyclicReference
	// FragmentDefinitionOnLeafNode is a Description of type FragmentDefinitionOnLeafNode
	FragmentDefinitionOnLeafNode
	// FragmentRedeclared is a Description of type FragmentRedeclared
	FragmentRedeclared
	// FragmentDeclaredButNeverUsed is a Description of type FragmentDeclaredButNeverUsed
	FragmentDeclaredButNeverUsed
	// InputValueNotDefined is a Description of type InputValueNotDefined
	InputValueNotDefined
	// MustHaveTypeCondition is a Description of type MustHaveTypeCondition
	MustHaveTypeCondition
	// OperationNameMustBeUnique is a Description of type OperationNameMustBeUnique
	OperationNameMustBeUnique
	// RootTypeNotDefined is a Description of type RootTypeNotDefined
	RootTypeNotDefined
	// SelectionSetInvalid is a Description of type SelectionSetInvalid
	SelectionSetInvalid
	// SelectionSetResponseShapesCannotMerge is a Description of type SelectionSetResponseShapesCannotMerge
	SelectionSetResponseShapesCannotMerge
	// SubscriptionsMustHaveMaxOneRootField is a Description of type SubscriptionsMustHaveMaxOneRootField
	SubscriptionsMustHaveMaxOneRootField
	// TypeNotDefined is a Description of type TypeNotDefined
	TypeNotDefined
	// ValueInvalid is a Description of type ValueInvalid
	ValueInvalid
	// VariableMustBeUniquePerOperation is a Description of type VariableMustBeUniquePerOperation
	VariableMustBeUniquePerOperation
	// VariableMustBeValidInputType is a Description of type VariableMustBeValidInputType
	VariableMustBeValidInputType
	// VariableNotDefined is a Description of type VariableNotDefined
	VariableNotDefined
	// VariableDefinedButNotUsed is a Description of type VariableDefinedButNotUsed
	VariableDefinedButNotUsed
)

func ParseDescription

func ParseDescription(name string) (Description, error)

ParseDescription attempts to convert a string to a Description

func (Description) String

func (x Description) String() string

String implements the Stringer interface.

type Meta

type Meta struct {
	SubjectPosition position.Position
	SubjectNameRef  int
}

type Result

type Result struct {
	Valid       bool
	RuleName    RuleName
	Description Description
	Meta        Meta
}

func Invalid

func Invalid(ruleName RuleName, description Description, subjectPosition position.Position, subjectNameRef int) Result

func Valid

func Valid() Result

type RuleName

type RuleName int

ENUM( NoRule ArgumentUniqueness DirectivesAreDefined DirectivesAreInValidLocations DirectivesAreUniquePerLocation FieldSelectionMerging FieldSelections Fragments LoneAnonymousOperation OperationNameUniqueness RequiredArguments SubscriptionSingleRootField ValidArguments Values VariableUniqueness VariablesAreInputTypes AllVariablesUsed AllVariableUsesDefined )

const (
	// NoRule is a RuleName of type NoRule
	NoRule RuleName = iota
	// ArgumentUniqueness is a RuleName of type ArgumentUniqueness
	ArgumentUniqueness
	// DirectivesAreDefined is a RuleName of type DirectivesAreDefined
	DirectivesAreDefined
	// DirectivesAreInValidLocations is a RuleName of type DirectivesAreInValidLocations
	DirectivesAreInValidLocations
	// DirectivesAreUniquePerLocation is a RuleName of type DirectivesAreUniquePerLocation
	DirectivesAreUniquePerLocation
	// FieldSelectionMerging is a RuleName of type FieldSelectionMerging
	FieldSelectionMerging
	// FieldSelections is a RuleName of type FieldSelections
	FieldSelections
	// Fragments is a RuleName of type Fragments
	Fragments
	// LoneAnonymousOperation is a RuleName of type LoneAnonymousOperation
	LoneAnonymousOperation
	// OperationNameUniqueness is a RuleName of type OperationNameUniqueness
	OperationNameUniqueness
	// RequiredArguments is a RuleName of type RequiredArguments
	RequiredArguments
	// SubscriptionSingleRootField is a RuleName of type SubscriptionSingleRootField
	SubscriptionSingleRootField
	// ValidArguments is a RuleName of type ValidArguments
	ValidArguments
	// Values is a RuleName of type Values
	Values
	// VariableUniqueness is a RuleName of type VariableUniqueness
	VariableUniqueness
	// VariablesAreInputTypes is a RuleName of type VariablesAreInputTypes
	VariablesAreInputTypes
	// AllVariablesUsed is a RuleName of type AllVariablesUsed
	AllVariablesUsed
	// AllVariableUsesDefined is a RuleName of type AllVariableUsesDefined
	AllVariableUsesDefined
)

func ParseRuleName

func ParseRuleName(name string) (RuleName, error)

ParseRuleName attempts to convert a string to a RuleName

func (RuleName) String

func (x RuleName) String() string

String implements the Stringer interface.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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