Documentation ¶
Index ¶
- Variables
- func AstPrimitiveProtoKind(typ ast.Type) (proto.RGQLPrimitive_Kind, bool)
- func IsAstPrimitive(typ ast.Type) bool
- func IsPrimEquiv(a, b *proto.RGQLPrimitive) bool
- func IsPrimitive(name string) bool
- func NewASTPrimitive(val ast.Value) (*proto.RGQLPrimitive, error)
- func NewBoolPrimitive(val bool) *proto.RGQLPrimitive
- func NewFloatPrimitive(val float64) *proto.RGQLPrimitive
- func NewIntPrimitive(val int32) *proto.RGQLPrimitive
- func NewNullPrimitive() *proto.RGQLPrimitive
- func NewStringPrimitive(val string) *proto.RGQLPrimitive
- func UnpackPrimitive(prim *proto.RGQLPrimitive) interface{}
- type GraphQLPrimitiveScalar
Constants ¶
This section is empty.
Variables ¶
var GraphQLPrimitivesAST map[string]ast.TypeDefinition
GraphQLPrimitivesAST maps named primitive types to scalar definitions.
var GraphQLPrimitivesKinds = map[string]string{
"Int": "SCALAR",
"String": "SCALAR",
"Float": "SCALAR",
"Boolean": "SCALAR",
"Object": "OBJECT",
"ID": "SCALAR",
}
var GraphQLPrimitivesProtoKinds = map[string]proto.RGQLPrimitive_Kind{ "Int": proto.RGQLPrimitive_PRIMITIVE_KIND_INT, "String": proto.RGQLPrimitive_PRIMITIVE_KIND_STRING, "Float": proto.RGQLPrimitive_PRIMITIVE_KIND_FLOAT, "Boolean": proto.RGQLPrimitive_PRIMITIVE_KIND_BOOL, "Object": proto.RGQLPrimitive_PRIMITIVE_KIND_OBJECT, "ID": proto.RGQLPrimitive_PRIMITIVE_KIND_STRING, }
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 ¶
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 ¶
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.