httpgql

package
v0.0.0-...-f420c12 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2022 License: BSD-2-Clause Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MarshalID

func MarshalID(kind string, spec interface{}) customtypes.ID

func ToWsURL

func ToWsURL(url string) (string, error)

func UnmarshalKind

func UnmarshalKind(id customtypes.ID) string

func UnmarshalSpec

func UnmarshalSpec(id customtypes.ID, v interface{}) error

func Upgrade

func Upgrade(w http.ResponseWriter, r *http.Request, streamingHandlerFunc graphql.ServeGraphQLStreamFunc)

Types

type Client

type Client struct {
	URL        string
	HTTPClient *http.Client

	RequestHeader http.Header
	// contains filtered or unexported fields
}

func NewClient

func NewClient(url string) *Client

func (*Client) Exec

func (client *Client) Exec(ctx context.Context, result interface{}, query string, args ...interface{}) error

func (*Client) ServeGraphQL

func (client *Client) ServeGraphQL(request *graphql.Request) *graphql.Response

func (*Client) ServeGraphQLStream

func (client *Client) ServeGraphQLStream(request *graphql.Request) graphql.ResponseStream

type Handler

type Handler struct {
	ServeGraphQL        graphql.ServeGraphQLFunc
	ServeGraphQLStream  graphql.ServeGraphQLStreamFunc
	MaxRequestSizeBytes int64
	Indent              string
}

func (*Handler) ServeHTTP

func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type OperationMessage

type OperationMessage struct {
	Id      interface{}     `json:"id,omitempty"`
	Type    string          `json:"type,omitempty"`
	Payload json.RawMessage `json:"payload,omitempty"`
}

Jump to

Keyboard shortcuts

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