gqlbuilder

package module
v0.0.0-...-f765e3e Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2018 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	RootQuery        = "Query"
	RootMutation     = "Mutation"
	RootSubscription = "Subscription"

	RootQueryDescription        = "The query root."
	RootMutationDescription     = "The mutation root."
	RootSubscriptionDescription = "The subscription root."
)
View Source
var (
	EdgesDesc      = "A list of edges."
	NodesDesc      = "A list of nodes."
	PageInfoDesc   = "Information to aid in pagination."
	TotalCountDesc = "Identifies the total count of items in the connection."
)
View Source
var (
	CursorDesc = "A cursor for use in pagination."
	NodeDesc   = "The item at the end of the edge."
)

Functions

func Build

func Build(topics *[]func() *SchemaTopic) (*gql.Schema, error)

This is the entry for building a whole schema.

func DateTimeScalar

func DateTimeScalar() *gql.Scalar

func NewConnection

func NewConnection(config ConnectionConfig) *gql.Object

func NewEdge

func NewEdge(config EdgeConfig) *gql.Object

func NodeInterface

func NodeInterface() *gql.Interface

func PageInfoType

func PageInfoType() *gql.Object

func Topics

func Topics(topics ...func() *SchemaTopic) *[]func() *SchemaTopic

Shortcut for *[]func() *

Types

type ConnectionConfig

type ConnectionConfig struct {
	// The type which will be listed/paged then.
	Type *gql.Object

	// Optional: If nil the edge type is generated.
	TypeEdge *gql.Object
	// Optional: the connection's name
	Name string
	// Optional: the connection's description
	Description string
}

type EdgeConfig

type EdgeConfig struct {
	// The type which will be listed/paged/cursored then.
	Type *gql.Object

	// Optional: the edge's name
	Name string
	// Optional: the edge's description
	Description string
}

type InitTopic

type InitTopic interface {
	InitTopic() func() *SchemaTopic
}

type SchemaTopic

type SchemaTopic struct {
	QueryFields        *gql.Fields
	MutationFields     *gql.Fields
	SubscriptionFields *gql.Fields

	Types []*gql.Type

	Directives []*gql.Directive
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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