Documentation ¶
Index ¶
- Variables
- func AnyFieldListToObjectFieldList(fields ast.FieldList) (ast.FieldList, error)
- func AnyFieldToObjectField(field ast.FieldDefinition) (*ast.FieldDefinition, error)
- func AppendFieldIfNotExists(fields []*ast.FieldDefinition, field *ast.FieldDefinition) []*ast.FieldDefinition
- func ArgsToFields(args ast.ArgumentDefinitionList) ast.FieldList
- func ArgsToObjectFields(args ast.ArgumentDefinitionList) ast.FieldList
- func ArgsToStruct[T any](args ast.ArgumentList, st *T) error
- func DirectiveToType(directive *ast.DirectiveDefinition, pos *ast.Position) *ast.Definition
- func FindObjectByResourceName(schema *ast.Schema, name string) *ast.Definition
- func GetDefinedObjects(schema *ast.Schema, hasDirectives ...string) map[string]*ast.Definition
- func GetResourceDirectiveSingularType(schema *ast.Schema, directive *ast.Directive) (*ast.Type, error)
- func IsMutationAction(directive *ast.Directive) bool
- func IsQueryAction(directive *ast.Directive) bool
- func IsXgenDirectiveDefinition(directive *ast.DirectiveDefinition) bool
- func ToObjectDefinition(def ast.Definition, newName string) *ast.Definition
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ExcludeArgumentFromTypeDirective = directives.InputObjectDirectiveDefinition{ Definition: &ast.DirectiveDefinition{ Name: consts.ExcludeArgumentFromType, Description: `This directive is used to exclude the argument from the type`, Position: pos, Locations: []ast.DirectiveLocation{ ast.LocationArgumentDefinition, }, Arguments: ast.ArgumentDefinitionList{ { Name: "exclude", Type: ast.NamedType("Boolean", nil), }, }, }, } )
View Source
var ( ToObjectType = directives.InputObjectDirectiveDefinition{ Definition: &ast.DirectiveDefinition{ Name: consts.ToObjectType, Description: `This directive is used to define the object type`, Position: pos, Locations: []ast.DirectiveLocation{ ast.LocationArgumentDefinition, ast.LocationInputFieldDefinition, ast.LocationFieldDefinition, }, Arguments: ast.ArgumentDefinitionList{ { Name: "type", Type: ast.NonNullNamedType("String", nil), }, }, }, } )
Functions ¶
func AnyFieldToObjectField ¶
func AnyFieldToObjectField(field ast.FieldDefinition) (*ast.FieldDefinition, error)
func AppendFieldIfNotExists ¶
func AppendFieldIfNotExists(fields []*ast.FieldDefinition, field *ast.FieldDefinition) []*ast.FieldDefinition
AppendFieldIfNotExists appends field to fields if it doesn't exist
func ArgsToFields ¶
func ArgsToFields(args ast.ArgumentDefinitionList) ast.FieldList
ArgsToFields converts arguments to fields
func ArgsToObjectFields ¶
func ArgsToObjectFields(args ast.ArgumentDefinitionList) ast.FieldList
func ArgsToStruct ¶
func ArgsToStruct[T any](args ast.ArgumentList, st *T) error
func DirectiveToType ¶
func DirectiveToType(directive *ast.DirectiveDefinition, pos *ast.Position) *ast.Definition
DirectiveToType converts directive to type
func FindObjectByResourceName ¶
func FindObjectByResourceName(schema *ast.Schema, name string) *ast.Definition
FindObjectByResourceName finds object by resource name
func GetDefinedObjects ¶
GetDefinedObjects returns all defined objects in schema
func GetResourceDirectiveSingularType ¶
func GetResourceDirectiveSingularType(schema *ast.Schema, directive *ast.Directive) (*ast.Type, error)
GetResourceDirectiveSingularType returns resource directive singular type
func IsMutationAction ¶
IsMutationAction checks if directive is mutation action
func IsQueryAction ¶
IsQueryAction checks if directive is query action
func IsXgenDirectiveDefinition ¶
func IsXgenDirectiveDefinition(directive *ast.DirectiveDefinition) bool
IsXgenDirectiveDefinition checks if directive is xgen directive
func ToObjectDefinition ¶
func ToObjectDefinition(def ast.Definition, newName string) *ast.Definition
ToObjectDefinition converts ast.Definition with any Kind to ast.Definition with a Kind is ast.Object
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.