Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Any = graphql.NewObject(graphql.ObjectConfig{ Name: "Any", Description: "google.protobuf.Any", Fields: graphql.Fields{ "type_url": &graphql.Field{ Type: String, }, "value": &graphql.Field{ Type: Bytes, }, }, })
Any see https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/any.proto
View Source
var Bool = graphql.Boolean
View Source
var Bytes = graphql.NewScalar(graphql.ScalarConfig{ Name: "Bytes", Description: "bytes", Serialize: func(value interface{}) interface{} { src, ok := value.([]byte) if !ok { return "nil" } return base64.StdEncoding.EncodeToString(src) }, })
View Source
var Duration = graphql.NewObject(graphql.ObjectConfig{ Name: "Duration", Description: "google.protobuf.Duration", Fields: graphql.Fields{ "seconds": &graphql.Field{ Type: graphql.NewNonNull(Int64), }, "nanos": &graphql.Field{ Type: graphql.NewNonNull(Int32), }, }, })
Duration see https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/duration.proto
View Source
var Empty = graphql.NewScalar(graphql.ScalarConfig{
Name: "Empty",
Description: "google.protobuf.Empty",
Serialize: func(_ interface{}) interface{} {
empty := struct{}{}
return empty
},
})
Empty a generic empty message see https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/empty.proto
View Source
var Float32 = graphql.NewScalar(graphql.ScalarConfig{ Name: "Float", Description: "float32", Serialize: coerceFloat32, ParseValue: coerceFloat32, ParseLiteral: func(valueAST ast.Value) interface{} { switch val := valueAST.(type) { case *ast.FloatValue: if v, err := strconv.ParseFloat(val.Value, 32); err == nil { return float32(v) } } return nil }, })
View Source
var Float64 = graphql.NewScalar(graphql.ScalarConfig{ Name: "Double", Description: "float64", Serialize: coerceFloat64, ParseValue: coerceFloat64, ParseLiteral: func(valueAST ast.Value) interface{} { switch val := valueAST.(type) { case *ast.FloatValue: if v, err := strconv.ParseFloat(val.Value, 64); err == nil { return v } } return nil }, })
View Source
var Int32 = graphql.NewScalar(graphql.ScalarConfig{ Name: "Int32", Description: "int32", Serialize: coerceInt32, ParseValue: coerceInt32, ParseLiteral: func(valueAST ast.Value) interface{} { switch val := valueAST.(type) { case *ast.IntValue: if v, err := strconv.ParseInt(val.Value, 10, 32); err == nil { return int32(v) } } return nil }, })
View Source
var Int64 = graphql.NewScalar(graphql.ScalarConfig{ Name: "Int64", Description: "int64", Serialize: coerceInt64, ParseValue: coerceInt64, ParseLiteral: func(valueAST ast.Value) interface{} { switch val := valueAST.(type) { case *ast.IntValue: if v, err := strconv.ParseInt(val.Value, 10, 64); err == nil { return v } } return nil }, })
View Source
var String = graphql.String
View Source
var Timestamp = graphql.NewObject(graphql.ObjectConfig{ Name: "Timestamp", Description: "google.protobuf.Timestamp", Fields: graphql.Fields{ "seconds": &graphql.Field{ Type: graphql.NewNonNull(Int64), }, "nanos": &graphql.Field{ Type: graphql.NewNonNull(Int32), }, }, })
Timestamp see https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/timestamp.proto
View Source
var Uint32 = graphql.NewScalar(graphql.ScalarConfig{ Name: "Uint32", Description: "uint32", Serialize: coerceUint32, ParseValue: coerceUint32, ParseLiteral: func(valueAST ast.Value) interface{} { switch val := valueAST.(type) { case *ast.IntValue: if v, err := strconv.ParseUint(val.Value, 10, 32); err == nil { return uint32(v) } } return nil }, })
View Source
var Uint64 = graphql.NewScalar(graphql.ScalarConfig{ Name: "Uint64", Description: "uint64", Serialize: coerceUint64, ParseValue: coerceUint64, ParseLiteral: func(valueAST ast.Value) interface{} { switch val := valueAST.(type) { case *ast.IntValue: if v, err := strconv.ParseUint(val.Value, 10, 64); err == nil { return v } } return nil }, })
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.