gqltypes

package
v0.0.0-...-b68b127 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var JSON = graphql.NewScalar(
	graphql.ScalarConfig{
		Name:        "JSON",
		Description: "The `JSON` scalar type represents JSON values",
		Serialize: func(value interface{}) interface{} {
			return value
		},
		ParseValue: func(value interface{}) interface{} {
			return value
		},
		ParseLiteral: parseLiteral,
	},
)

JSON json type

View Source
var StatsType = graphql.NewObject(graphql.ObjectConfig{
	Name:        "Stats",
	Description: "Server statistics",
	Fields: graphql.Fields{
		"totalWebSocketConnection": &graphql.Field{
			Type:        graphql.Int,
			Description: "Total Active Web Socket Connection",
		},
	},
})
View Source
var TokenPayloadType = graphql.NewObject(graphql.ObjectConfig{
	Name:        "TokenPayload",
	Description: "JSON Web Token Payload",
	Fields: graphql.Fields{
		"isValid": &graphql.Field{
			Type:        graphql.NewNonNull(graphql.Boolean),
			Description: "Is JSON Web Token valid",
		},
		"payload": &graphql.Field{
			Type:        JSON,
			Description: "JSON Web Token key value pair",
		},
	},
})
View Source
var TokenType = graphql.NewObject(graphql.ObjectConfig{
	Name:        "Token",
	Description: "JSON Web Token",
	Fields: graphql.Fields{
		"token": &graphql.Field{
			Type:        graphql.NewNonNull(graphql.String),
			Description: "JWT encoded string",
		},
	},
})

Functions

This section is empty.

Types

type ErrorType

type ErrorType struct {
	Messages    []interface{} `json:"messages"`
	MessageType string        `json:"type"`
	Group       int           `json:"group"`
	Code        int           `json:"code"`
	TraceID     string        `json:"trace_id"`
}

func NewErrorType

func NewErrorType() *ErrorType

func (*ErrorType) AddMessage

func (e *ErrorType) AddMessage(message interface{})

func (*ErrorType) AddStringMessage

func (e *ErrorType) AddStringMessage(message string)

type Stats

type Stats struct {
	TotalWebSocketConnection int `json:"totalWebSocketConnection"`
}

type Token

type Token struct {
	Token string `json:"token"`
}

type TokenPayload

type TokenPayload struct {
	IsValid bool                   `json:"isValid"`
	Payload map[string]interface{} `json:"payload"`
}

Jump to

Keyboard shortcuts

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