Documentation ¶
Index ¶
- Variables
- func Argument(desc protoreflect.MessageDescriptor) gql.FieldConfigArgument
- func DecodeBytes(input string) []byte
- func Enum(desc protoreflect.EnumDescriptor) *gql.Enum
- func Input(desc protoreflect.MessageDescriptor) *gql.InputObject
- func Object(desc protoreflect.MessageDescriptor) *gql.Object
Constants ¶
This section is empty.
Variables ¶
View Source
var Bytes = gql.NewScalar(gql.ScalarConfig{ Name: "Bytes", Description: "Bytes scalar to encode []byte to base64 string and decode base64 string to []byte", Serialize: func(value interface{}) interface{} { switch value := value.(type) { case []byte: return base64.StdEncoding.EncodeToString(value) case string: return value default: return nil } }, ParseValue: func(value interface{}) interface{} { switch value := value.(type) { case string: return DecodeBytes(value) case []byte: return value default: return nil } }, ParseLiteral: func(valueAST ast.Value) interface{} { return nil }, })
Custom scalar type for []byte to base64 string and vice versa
View Source
var JSON = gql.NewScalar( gql.ScalarConfig{ Name: "JSON", Description: "The `JSON` scalar type represents JSON values as specified by [ECMA-404](http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf)", Serialize: func(value interface{}) interface{} { return value }, ParseValue: func(value interface{}) interface{} { return value }, ParseLiteral: parseLiteralJSON, }, )
JSON json type
Functions ¶
func Argument ¶
func Argument(desc protoreflect.MessageDescriptor) gql.FieldConfigArgument
func Enum ¶
func Enum(desc protoreflect.EnumDescriptor) *gql.Enum
func Input ¶
func Input(desc protoreflect.MessageDescriptor) *gql.InputObject
func Object ¶
func Object(desc protoreflect.MessageDescriptor) *gql.Object
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.