types

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2023 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 v0.5.0

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 v0.6.0

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

IsPrimEquiv checks if the two primitives are equivilent.

func IsPrimitive

func IsPrimitive(name string) bool

IsPrimitive checks if the type name is a primitive.

func NewASTPrimitive added in v0.6.0

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

NewASTPrimitive converts an ast.Value to a primitive.

func NewBoolPrimitive added in v0.6.0

func NewBoolPrimitive(val bool) *proto.RGQLPrimitive

NewBoolPrimitive returns a boolean primitive.

func NewFloatPrimitive added in v0.6.0

func NewFloatPrimitive(val float64) *proto.RGQLPrimitive

NewFloatPrimitive returns a float primitive.

func NewIntPrimitive added in v0.6.0

func NewIntPrimitive(val int32) *proto.RGQLPrimitive

NewIntPrimitive returns a int primitive.

func NewNullPrimitive added in v0.6.0

func NewNullPrimitive() *proto.RGQLPrimitive

NewNullPrimitive returns the null primitive.

func NewStringPrimitive added in v0.6.0

func NewStringPrimitive(val string) *proto.RGQLPrimitive

NewStringPrimitive returns a string primitive.

func UnpackPrimitive added in v0.6.0

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