gql

package
v0.15.1 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2024 License: GPL-3.0 Imports: 23 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var PubSub = &SourceEvents{
	subscriptionEvents: make(map[OperationID]chan interface{}, 0),
	operationEvents:    make(map[OperationID]map[EventID]*Subscription, 0),
}

Functions

func OnAuthorizate added in v0.12.0

func OnAuthorizate(authInfo AuthorizateInfo) (err definitionError.GQLError)

func OnIntrospection added in v0.12.0

func OnIntrospection() (err definitionError.GQLError)

Types

type Access added in v0.12.0

type Access []string

type AuthorizateInfo added in v0.12.0

type AuthorizateInfo struct {
	Operation string
	SrcType   TypeName
	DstType   TypeName
	Resolver  ResolverName
	SessionID string
}

type DefaultArguments

type DefaultArguments struct {
	Name    string
	IsArray bool
	Value   interface{}
	NonNull bool
	Kind    string
	Type    string
}

type Directives

type Directives map[string]resolvers.Directive

type EventID

type EventID string

type Gql added in v0.15.0

type Gql struct {
	OnIntrospection  func() (err definitionError.GQLError)
	OnAuthorizate    func(authInfo AuthorizateInfo) definitionError.GQLError
	OnScalarArgument func(scalarType string, value interface{}) (r interface{})
	// contains filtered or unexported fields
}

func Init

func Init(filesystem systemutils.FSInterface, folder string) *Gql

func (*Gql) Directive added in v0.15.0

func (o *Gql) Directive(resolver string, object resolvers.Directive)

func (*Gql) GQLRender added in v0.15.0

func (o *Gql) GQLRender(w http.ResponseWriter, r *http.Request, sessionID string) (isErr bool)

func (*Gql) GQLRenderSubscription added in v0.15.0

func (o *Gql) GQLRenderSubscription(mt int, message []byte, socketId, sessionID string)

func (*Gql) GetScalars added in v0.15.0

func (o *Gql) GetScalars() Scalars

func (*Gql) GetSchema added in v0.15.0

func (o *Gql) GetSchema() *ast.Schema

func (*Gql) ObjectType added in v0.15.0

func (o *Gql) ObjectType(resolver string, object resolvers.ObjectTypeInterface)

func (*Gql) Scalar added in v0.15.0

func (o *Gql) Scalar(resolver string, object resolvers.Scalar)

func (*Gql) WebsocketResponse added in v0.15.0

func (o *Gql) WebsocketResponse(request HttpRequest, socketId string, requestID RequestID, mt int, sessionID string)

func (*Gql) WriteWebsocketMessage added in v0.15.0

func (o *Gql) WriteWebsocketMessage(mt int, socketId string, requestID RequestID, response *HttpResponse)

type Grant added in v0.12.0

type Grant map[TypeName]map[TypeName]map[ResolverName]Access

type HttpRequest

type HttpRequest struct {
	Query         string                 `json:"query"`
	Variables     map[string]interface{} `json:"variables,omitempty"`
	OperationName string                 `json:"operationName,omitempty"`
}

type HttpResponse

type HttpResponse struct {
	Data   string `json:"data,omitempty"`
	Errors string `json:"errors,omitempty"`
}

type ObjectTypes

type ObjectTypes map[string]resolvers.ObjectTypeInterface

type OperationID

type OperationID string

type RequestID

type RequestID string

type ResolverName added in v0.12.0

type ResolverName string

type Response

type Response interface{}

type Scalars

type Scalars map[string]resolvers.Scalar

type SocketID

type SocketID string

type SourceEvents

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

func (*SourceEvents) Publish

func (o *SourceEvents) Publish(operationID OperationID, value interface{})

type Subscription

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

type SubscriptionClose

type SubscriptionClose struct{}

type TypeName added in v0.12.0

type TypeName string

type WebSocketRequest

type WebSocketRequest struct {
	Id      string      `json:"id"`
	Type    string      `json:"type"`
	Payload HttpRequest `json:"payload"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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