Documentation ¶
Index ¶
- Variables
- func DecodeBytes(input string) []byte
- func MakeMap(ptr interface{})
- func MakeSlice(ptr interface{}, size int)
- func MapFromBytes(data []byte) (res map[string]interface{}, err error)
- func ParseFloat(s string) float64
- type GraphqlArgument
- type GraphqlObject
- type GraphqlOutput
- type Message
- type Unmarshaler
Constants ¶
This section is empty.
Variables ¶
View Source
var Bytes = graphql.NewScalar(graphql.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) default: return nil } }, ParseValue: func(value interface{}) interface{} { switch value := value.(type) { case string: return DecodeBytes(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 = graphql.NewScalar( graphql.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 MapFromBytes ¶ added in v0.3.71
MapFromBytes ...
Types ¶
type GraphqlArgument ¶ added in v0.6.3
type GraphqlArgument interface { // Argument ... Argument() graphql.FieldConfigArgument }
GraphqlArgument ...
type GraphqlObject ¶ added in v0.3.73
GraphqlObject ...
type GraphqlOutput ¶ added in v0.6.0
GraphqlOutput ...
type Message ¶ added in v0.3.71
type Message interface {
Schema() map[string]interface{}
}
Message ...
type Unmarshaler ¶ added in v0.3.71
type Unmarshaler interface {
UnmarshalMap(m map[string]interface{})
}
Unmarshaler ...
Click to show internal directories.
Click to hide internal directories.