actions

package
v0.396.4 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2024 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ActionModelInputsRule

func ActionModelInputsRule(asts []*parser.AST) (errs errorhandling.ValidationErrors)

func ActionTypesRule

func ActionTypesRule(asts []*parser.AST) (errs errorhandling.ValidationErrors)

validate only read+write can be used with returns validate returns has to be specified with read+write

func CreateOperationNoReadInputsRule

func CreateOperationNoReadInputsRule(asts []*parser.AST) (errs errorhandling.ValidationErrors)

CreateOperationNoReadInputsRule validates that create actions don't accept any read-only inputs

func CreateOperationRequiredFieldsRule

func CreateOperationRequiredFieldsRule(
	asts []*parser.AST) (errs errorhandling.ValidationErrors)

CreateOperationRequiredFieldsRule makes sure that all create operation are specified in such a way that all the fields that must be populated during a create, are covered by either inputs or set expressions. This includes (recursively) the fields in nested models where appropriate.

func UniqueActionNamesRule

func UniqueActionNamesRule(asts []*parser.AST) (errs errorhandling.ValidationErrors)

func ValidActionInputLabelRule

func ValidActionInputLabelRule(asts []*parser.AST) (errs errorhandling.ValidationErrors)

ValidActionInputLabelRule makes sure that labels like "foo" in this case <getPerson(foo: ID)> are only used when the type of the input has a built-in type (ID is a built-in type, as are Text, Bool etc.)

Conversely, using an alias is not allowed when the input references a field on THIS model, because that is simultaneously providing us with a name for the input AND its type. E.g. <getPerson(id)>. "id" is a field on the model, as could be "name" etc.

func ValidActionInputTypesRule

func ValidActionInputTypesRule(asts []*parser.AST) (errs errorhandling.ValidationErrors)

ValidActionInputTypesRule makes sure the inputs specified for all the actions in the schema (i.e. operations and functions), are well formed and conform to various rules.

func ValidArbitraryFunctionReturns

func ValidArbitraryFunctionReturns(asts []*parser.AST) (errs errorhandling.ValidationErrors)

Types

This section is empty.

Jump to

Keyboard shortcuts

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