package
1.5.3
Repository: https://github.com/apito-cms/wsgraphql.git
Documentation: pkg.go.dev

# Packages

Package apollows provides implementation of GraphQL over WebSocket Protocol as defined by https://github.com/apollographql/subscriptions-transport-ws/blob/master/PROTOCOL.md [GWS] https://github.com/enisdenjo/graphql-ws/blob/master/PROTOCOL.md [GTWS].
No description provided by the author
No description provided by the author
Package mutable provides v1.mutable context, that can store multiple values and be updated after creation.

# Functions

ContextAST returns operation's abstract syntax tree document.
ContextHTTPRequest returns http request stored in a context.
ContextHTTPResponseStarted returns true if HTTP response has already headers sent.
ContextHTTPResponseWriter returns http response writer stored in a context.
ContextOperationExecuted returns true if user requested operation stop.
ContextOperationID returns operaion ID stored in the context.
ContextOperationParams returns operation params stored in the context.
ContextOperationStopped returns true if user requested operation stop.
ContextSubscription returns operation's subscription flag.
ContextWebsocketConnection returns websocket connection stored in a context.
FormatError returns error formatted as graphql error.
InterceptorHTTPRequestChain returns interceptor composed of the provided list.
InterceptorInitChain returns interceptor composed of the provided list.
InterceptorOperationChain returns interceptor composed of the provided list.
InterceptorOperationExecuteChain returns interceptor composed of the provided list.
InterceptorOperationParseChain returns interceptor composed of the provided list.
NewServer returns new Server instance.
OperationContext returns graphql operation-scoped v1.mutable context from provided context or nil if none present.
RequestContext returns HTTP request-scoped v1.mutable context from provided context or nil if none present.
WithCallbacks option sets callbacks handling various stages of requests Deprecated: use WithInterceptors / WithResultProcessor.
WithConnectTimeout option sets duration within which client is allowed to initialize the connection before being disconnected.
WithExtraInterceptors option appends interceptors instead of replacing them.
WithInterceptors option sets interceptors around various stages of requests.
WithKeepalive enabled sending keepalive messages with provided intervals.
WithoutHTTPQueries option prevents HTTP queries from being handled, allowing only websocket queries.
WithProtocol option sets protocol for this sever to use.
WithResultProcessor provides ResultProcessor to post-process resolved values.
WithRootObject provides root object that will be used in root resolvers.
WithUpgrader option sets Upgrader (interface in image of gorilla websocket upgrader).
WriteError helper function writing an error to http.ResponseWriter.

# Constants

WebsocketSubprotocolGraphqlTransportWS websocket subprotocol expected by graphql-ws implementations.
WebsocketSubprotocolGraphqlWS websocket subprotocol expected by subscriptions-transport-ws implementations.

# Variables

ContextKeyAST used to store operation's ast.Document (abstract syntax tree).
ContextKeyHTTPRequest used to store HTTP request.
ContextKeyHTTPResponseStarted used to indicate HTTP response already has headers sent.
ContextKeyHTTPResponseWriter used to store HTTP response.
ContextKeyOperationContext used to store graphql operation-scoped mutable.Context.
ContextKeyOperationExecuted indicates the operation was executed.
ContextKeyOperationID indicates the operation ID.
ContextKeyOperationParams used to store operation params.
ContextKeyOperationStopped indicates the operation was stopped on client request.
ContextKeyRequestContext used to store HTTP request-scoped mutable.Context.
ContextKeySubscription used to store operation subscription flag.
ContextKeyWebsocketConnection used to store websocket connection.

# Structs

Callbacks supported by the server use wsgraphql.ContextHTTPRequest / wsgraphql.ContextHTTPResponseWriter to access underlying http.Request and http.ResponseWriter Sequence: OnRequest -> OnConnect -> [ OnOperation -> OnOperationValidation -> OnOperationResult -> OnOperationDone ]* -> OnDisconnect -> OnRequestDone Deprecated: use Interceptors / ResultProcessor.
Interceptors allow to customize request processing Sequence: HTTPRequest -> Init -> [ Operation -> OperationParse -> OperationExecute ]*.
ResultError passes error result as error.

# Interfaces

Conn interface is used to abstract connection returned from Upgrader.
Server implements graphql http handler with websocket support (if upgrader is provided with WithUpgrader).
Upgrader interface used to upgrade HTTP request/response pair into a Conn.

# Type aliases

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
ResultProcessor allows to post-process resolved values.
ServerOption to configure Server.