gql

package
v0.12.17 Latest Latest
Warning

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

Go to latest
Published: May 28, 2020 License: MIT Imports: 16 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FmtID added in v0.12.6

func FmtID(format string, args ...interface{}) string

func MarshalInt

func MarshalInt(t int) graphql.Marshaler

MarshalInt implements a Int value

func MarshalInt32

func MarshalInt32(t int32) graphql.Marshaler

MarshalInt32 implements a Int32 value

func MarshalInt64

func MarshalInt64(t int64) graphql.Marshaler

MarshalInt64 implements a Int64 value

func MarshalNullInt64

func MarshalNullInt64(b sql.NullInt64) graphql.Marshaler

MarshalNullInt64 is a nullable int marshaller

func MarshalNullUint64

func MarshalNullUint64(t uint64) graphql.Marshaler

MarshalNullUint64 overrides the default data type of NullUint for graphQL

func MarshalUint

func MarshalUint(t uint) graphql.Marshaler

MarshalUint implements a Uint value

func MarshalUint32

func MarshalUint32(t uint32) graphql.Marshaler

MarshalUint32 implements a Uint32 value

func MarshalUint64

func MarshalUint64(t uint64) graphql.Marshaler

MarshalUint64 implements a Uint64 value

func SplitID added in v0.12.6

func SplitID(id string) ([]string, error)

SplitID decodes base64 if needed and splits ID

func UnmarshalInt

func UnmarshalInt(v interface{}) (int, error)

UnmarshalInt implements a Int value

func UnmarshalInt32

func UnmarshalInt32(v interface{}) (int32, error)

UnmarshalInt32 implements a Int32 value

func UnmarshalInt64

func UnmarshalInt64(v interface{}) (int64, error)

UnmarshalInt64 implements a Int64 value

func UnmarshalNullInt64

func UnmarshalNullInt64(v interface{}) (i sql.NullInt64, err error)

UnmarshalNullInt64 is a nullable int unmarshaller

func UnmarshalUint

func UnmarshalUint(v interface{}) (uint, error)

UnmarshalUint implements a Uint value

func UnmarshalUint32

func UnmarshalUint32(v interface{}) (uint32, error)

UnmarshalUint32 implements a Uint32 value

func UnmarshalUint64

func UnmarshalUint64(v interface{}) (uint64, error)

UnmarshalUint64 implements a Uint64 value

Types

type AppInfo

type AppInfo struct {
	// Application Name
	Name string `json:"name"`
	// Version number
	Version string `json:"version"`
	// Build information
	Build string `json:"build"`
}

AppInfo about running server

type GraphGQL

type GraphGQL struct{}

GraphGQL Implements the AppInfo method for query

func (GraphGQL) AppInfo

func (GraphGQL) AppInfo(ctx context.Context) (s *AppInfo, err error)

AppInfo returns app information

type GraphNode added in v0.12.6

type GraphNode struct {
	// contains filtered or unexported fields
}

GraphNode implements the node interface for Graphql

func (GraphNode) Node added in v0.12.6

func (nh GraphNode) Node(ctx context.Context, id string) (Node, error)

Node handles request from graphql

func (*GraphNode) Register added in v0.12.6

func (nh *GraphNode) Register(name string, fn NodeFn)

Register a new handler

type ListIDs

type ListIDs []uint64

ListIDs is a list of ID values.

func (ListIDs) MarshalJSON

func (e ListIDs) MarshalJSON() (out []byte, err error)

MarshalJSON implements the JSON interface for ListIDs.

func (*ListIDs) Scan

func (e *ListIDs) Scan(value interface{}) (err error)

Scan implements the Scanner interface for ListIDs.

func (*ListIDs) UnmarshalJSON

func (e *ListIDs) UnmarshalJSON(in []byte) error

UnmarshalJSON implements the JSON interface for ListIDs.

func (ListIDs) Value

func (e ListIDs) Value() (v driver.Value, err error)

Value implements the driver Valuer interface for ListIDs.

type ListStrings

type ListStrings []string

ListStrings is a list of String values.

func (ListStrings) MarshalJSON

func (e ListStrings) MarshalJSON() (out []byte, err error)

MarshalJSON implements the JSON interface for ListIDs.

func (*ListStrings) Scan

func (e *ListStrings) Scan(value interface{}) (err error)

Scan implements the Scanner interface for ListIDs.

func (*ListStrings) UnmarshalJSON

func (e *ListStrings) UnmarshalJSON(in []byte) error

UnmarshalJSON implements the JSON interface for ListStrings.

func (ListStrings) Value

func (e ListStrings) Value() (v driver.Value, err error)

Value implements the driver Valuer interface for ListStrings.

type Node added in v0.12.6

type Node interface {
	IsNode()
}

Node for use with graphql schema @goModel()

type NodeFn added in v0.12.6

type NodeFn func(ctx context.Context, id []string) (Node, error)

NodeFn handles a Node request for ID

type NullTime

type NullTime struct {
	Time  time.Time
	Valid bool // Valid is true if String is not NULL
}

NullTime implements a nullable timestamp for sql swagger:type string

func (NullTime) MarshalGQL

func (n NullTime) MarshalGQL(w io.Writer)

MarshalGQL implements the graphql.Marshaler interface for NullTime

func (NullTime) MarshalJSON

func (n NullTime) MarshalJSON() (out []byte, err error)

MarshalJSON implements the json.Marshaler interface for NullTime

func (*NullTime) Scan

func (n *NullTime) Scan(value interface{}) (err error)

Scan implements the SQL Scanner interface for NullTime.

func (*NullTime) UnmarshalGQL

func (n *NullTime) UnmarshalGQL(v interface{}) (err error)

UnmarshalGQL implements the graphql.Marshaler interface for NullTime

func (*NullTime) UnmarshalJSON

func (n *NullTime) UnmarshalJSON(in []byte) (err error)

UnmarshalJSON implements the json.Marshaler interface for NullTime

func (NullTime) Value

func (n NullTime) Value() (driver.Value, error)

Value implements the SQL driver Valuer interface.

type NullUint64

type NullUint64 struct {
	Uint64 uint64
	Valid  bool // Valid is true if Uint64 is not NULL
}

NullUint64 represents an int64 that may be null. NullUint64 implements the Scanner interface so it can be used as a scan destination, similar to NullString.

func UnmarshalNullUint64

func UnmarshalNullUint64(v interface{}) (n NullUint64, err error)

UnmarshalNullUint64 overrides the default data type of NullUint for graphQL

func (*NullUint64) Scan

func (n *NullUint64) Scan(value interface{}) (err error)

Scan implements the Scanner interface.

func (NullUint64) Value

func (n NullUint64) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type QueryInput

type QueryInput struct {
	Search *string  `json:"search"`
	Limit  *uint64  `json:"limit"`
	Offset *uint64  `json:"offset"`
	Sort   []string `json:"sort"`
}

QueryInput allows you to filter and page the search.

Jump to

Keyboard shortcuts

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