graphql

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package graphql defines the GraphQL messages.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ConnectionInit is the message to initialize the connection. (client -> server)
	ConnectionInit = map[string]interface{}{
		"type": "connection_init",
	}
)

Functions

func BuildSubscribeMessage

func BuildSubscribeMessage(payload SubscribeMessagePayload) map[string]interface{}

BuildSubscribeMessage builds a subscribe message.

Types

type ConnectionAckMessage

type ConnectionAckMessage struct {
	Type    string                 `json:"type"`
	Payload map[string]interface{} `json:"payload,omitempty"`
}

ConnectionAckMessage is the message to acknowledge the connection. (server -> client)

type Query

type Query struct {
	Query     string                 `json:"query"`
	Variables map[string]interface{} `json:"variables"`
}

Query is the GraphQL query.

This must be serialized to JSON and put in the Data field of the payload.

type SubscribeMessagePayload

type SubscribeMessagePayload struct {
	Data       string                 `json:"data"`
	Extensions map[string]interface{} `json:"extensions,omitempty"`
}

SubscribeMessagePayload is the payload of the subscribe message.

Jump to

Keyboard shortcuts

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