Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Time = &ScalarConfig{ ReflectType: reflect.TypeOf(time.Time{}), CoerceInput: func(input interface{}) (interface{}, error) { switch input := input.(type) { case time.Time: return input, nil case string: t, err := time.Parse(time.RFC3339, input) return t, err case int: return time.Unix(int64(input), 0), nil default: return nil, fmt.Errorf("wrong type") } }, }
Functions ¶
func SchemaToJSON ¶
Types ¶
type Response ¶
type Response struct { Data interface{} `json:"data,omitempty"` Errors []*errors.QueryError `json:"errors,omitempty"` Extensions map[string]interface{} `json:"extensions,omitempty"` }
type ScalarConfig ¶
type Schema ¶
type Schema struct {
// contains filtered or unexported fields
}
func MustParseSchema ¶
func ParseSchema ¶
type SchemaBuilder ¶
type SchemaBuilder struct {
// contains filtered or unexported fields
}
func New ¶
func New() *SchemaBuilder
func (*SchemaBuilder) AddCustomScalar ¶
func (b *SchemaBuilder) AddCustomScalar(name string, scalar *ScalarConfig)
func (*SchemaBuilder) ApplyResolver ¶
func (b *SchemaBuilder) ApplyResolver(resolver interface{}) (*Schema, error)
func (*SchemaBuilder) Parse ¶
func (b *SchemaBuilder) Parse(schemaString string) error
Click to show internal directories.
Click to hide internal directories.