scalars

package
v0.0.0-...-9285232 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 3, 2017 License: MIT Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Any *graphql.Scalar = graphql.NewScalar(graphql.ScalarConfig{
	Name:       "Any",
	Serialize:  coerceAny,
	ParseValue: coerceAny,
	ParseLiteral: func(valueAST ast.Value) interface{} {
		switch valueAST := valueAST.(type) {
		case *ast.StringValue:
			return valueAST.Value
		}
		return nil
	},
})

Any is the GraphQL Any type definition.

View Source
var ByteString *graphql.Scalar = graphql.NewScalar(graphql.ScalarConfig{
	Name:       "ByteString",
	Serialize:  coerceString,
	ParseValue: coerceString,
	ParseLiteral: func(valueAST ast.Value) interface{} {
		switch valueAST := valueAST.(type) {
		case *ast.StringValue:
			return valueAST.Value
		}
		return nil
	},
})

String is the GraphQL string type definition

View Source
var Error *graphql.Scalar = graphql.NewScalar(graphql.ScalarConfig{
	Name:       "Error",
	Serialize:  coerceError,
	ParseValue: coerceError,
	ParseLiteral: func(valueAST ast.Value) interface{} {
		switch valueAST := valueAST.(type) {
		case *ast.StringValue:
			return valueAST.Value
		}
		return nil
	},
})
View Source
var Map *graphql.Scalar = graphql.NewScalar(graphql.ScalarConfig{
	Name:       "Map",
	Serialize:  coerceMap,
	ParseValue: coerceMap,
	ParseLiteral: func(valueAST ast.Value) interface{} {
		switch valueAST := valueAST.(type) {
		case *ast.StringValue:
			return valueAST.Value
		}
		return nil
	},
})

Map is the GraphQL Map type definition.

View Source
var Permission *graphql.Scalar = graphql.NewScalar(graphql.ScalarConfig{
	Name:       "Permission",
	Serialize:  coercePermission,
	ParseValue: coercePermission,
	ParseLiteral: func(valueAST ast.Value) interface{} {
		switch valueAST := valueAST.(type) {
		case *ast.StringValue:
			return valueAST.Value
		}
		return nil
	},
})
View Source
var Timestamp *graphql.Scalar = graphql.NewScalar(graphql.ScalarConfig{
	Name:       "Timestamp",
	Serialize:  coerceInt,
	ParseValue: coerceInt,
	ParseLiteral: func(valueAST ast.Value) interface{} {
		switch valueAST := valueAST.(type) {
		case *ast.IntValue:
			if intValue, err := strconv.Atoi(valueAST.Value); err == nil {
				return intValue
			}
		}
		return nil
	},
})

Timestamp is the GraphQL Timestamp type definition.

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL