types

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: May 3, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GraphQLPrimitivesAST map[string]ast.TypeDefinition

GraphQLPrimitivesAST maps named primitive types to scalar definitions.

View Source
var GraphQLPrimitivesKinds = map[string]string{
	"Int":     "SCALAR",
	"String":  "SCALAR",
	"Float":   "SCALAR",
	"Boolean": "SCALAR",
	"Object":  "OBJECT",
	"ID":      "SCALAR",
}

GraphQLPrimitivesProtoKinds maps graphql primitive type names to proto primitive kinds.

Functions

func AstPrimitiveProtoKind added in v1.2.1

func AstPrimitiveProtoKind(typ ast.Type) (proto.RGQLPrimitive_Kind, bool)

AstPrimitiveProtoKind returns the primitive kind for the AST type.

func IsAstPrimitive

func IsAstPrimitive(typ ast.Type) bool

IsAstPrimitive checks if the ast type is a primitive.

func IsPrimEquiv added in v1.2.1

func IsPrimEquiv(a, b *proto.RGQLPrimitive) bool

IsPrimEquiv checks if the two primitives are equivalent.

func IsPrimitive

func IsPrimitive(name string) bool

IsPrimitive checks if the type name is a primitive.

func NewASTPrimitive added in v1.2.1

func NewASTPrimitive(val ast.Value) (*proto.RGQLPrimitive, error)

NewASTPrimitive converts an ast.Value to a primitive.

func NewBoolPrimitive added in v1.2.1

func NewBoolPrimitive(val bool) *proto.RGQLPrimitive

NewBoolPrimitive returns a boolean primitive.

func NewFloatPrimitive added in v1.2.1

func NewFloatPrimitive(val float64) *proto.RGQLPrimitive

NewFloatPrimitive returns a float primitive.

func NewIntPrimitive added in v1.2.1

func NewIntPrimitive(val int32) *proto.RGQLPrimitive

NewIntPrimitive returns a int primitive.

func NewNullPrimitive added in v1.2.1

func NewNullPrimitive() *proto.RGQLPrimitive

NewNullPrimitive returns the null primitive.

func NewStringPrimitive added in v1.2.1

func NewStringPrimitive(val string) *proto.RGQLPrimitive

NewStringPrimitive returns a string primitive.

func UnpackPrimitive added in v1.2.1

func UnpackPrimitive(prim *proto.RGQLPrimitive) interface{}

UnpackPrimitive unpacks a protobuf primitive.

Types

type GraphQLPrimitiveScalar

type GraphQLPrimitiveScalar struct {
	*ast.ScalarDefinition
	TypeKind string
}

GraphQLPrimitiveScalar defines a scalar type for each built-in primitive.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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