package
0.0.0-20220908142214-d213672e65e0
Repository: https://github.com/bitquery/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.
ContextOperationID returns operaion ID 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.
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.
WithConnectTimeout option sets duration within which client is allowed to initialize the connection before being disconnected.
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.
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.
ContextKeyOperationID indicates the operation ID.
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.
# Type aliases
ServerOption to configure Server.