Listener: Listener

Represents a Graphql listener endpoint.

Constructor

Invoked during the initialization of a graphql:Listener. Either an http:Listner or a port number must be provided to initialize the listener.

init (int | Listener listenTo, *ListenerConfiguration configuration)
  • listenTo int | Listener
  • An http:Listener or a port number to listen to the GraphQL service endpoint

LifeCycle Methods

attach

Attaches the provided service to the Listener.

Methods

detach

Detaches the provided service from the Listener.

'start

Starts the attached service.

gracefulStop

Gracefully stops the graphql listener.

immediateStop

Stops the service listener immediately.

attach

function attach(Service s, string[ ] | string? name) returns Error?
Isolated Function

Attaches the provided service to the Listener.

Parameters

  • s Service
  • The graphql:Service object to attach to the listener

  • name string[ ] | string? (default ())
  • The path of the service to be hosted

Return Type

(Error?)

A graphql:Error if an error occurred during the service-attaching process or the schema generation process or else ()

detach

function detach(Service s) returns Error?
Isolated Function

Detaches the provided service from the Listener.

Parameters

  • s Service
  • The service to be detached from the listener

Return Type

(Error?)

A graphql:Error if an error occurred during the service detaching process or else ()

'start

function 'start() returns Error?
Isolated Function

Starts the attached service.

Return Type

(Error?)

A graphql:Error, if an error occurred during the service starting process, otherwise nil

gracefulStop

function gracefulStop() returns Error?
Isolated Function

Gracefully stops the graphql listener. Already accepted requests will be served before the connection closure.

Return Type

(Error?)

A graphql:Error, if an error occurred during the service stopping process, otherwise nil

immediateStop

function immediateStop() returns Error?
Isolated Function

Stops the service listener immediately.

Return Type

(Error?)

A graphql:Error if an error occurred during the service stopping process or else ()