GraphqlServerOps

caliban.quick.`package`.GraphqlServerOps
final implicit class GraphqlServerOps[R](val gql: GraphQL[R]) extends AnyVal

Attributes

Graph
Supertypes
class AnyVal
trait Matchable
class Any

Members list

Value members

Concrete methods

def handlers(implicit trace: Trace): IO[ValidationError, QuickHandlers[R]]

Creates a zio-http handler for the GraphQL API

Creates a zio-http handler for the GraphQL API

Attributes

See also

handlersConfigured for a more powerful variant that allows configuring the GraphQL request execution

def handlersConfigured(config: ExecutionConfiguration)(implicit trace: Trace): IO[ValidationError, QuickHandlers[R]]

Creates a zio-http handler for the GraphQL API, allowing to configure the GraphQL request execution

Creates a zio-http handler for the GraphQL API, allowing to configure the GraphQL request execution

Attributes

def runServer(port: Int, apiPath: String, graphiqlPath: Option[String], uploadPath: Option[String], webSocketPath: Option[String])(implicit trace: Trace): RIO[R, Nothing]

Serves the GraphQL API on the specified port using the default zio-http configuration. This is meant as a convenience method for getting started quickly.

Serves the GraphQL API on the specified port using the default zio-http configuration. This is meant as a convenience method for getting started quickly.

Value parameters

apiPath

The route to serve the API on, e.g., /api/graphql

graphiqlPath

Optionally define a route to serve the GraphiQL UI on, e.g., /graphiql

port

The port to serve the API on

uploadPath

Optionally define a route to serve file uploads on, e.g., /api/upload

webSocketPath

The path where websocket requests will be set. If None, websocket-based subscriptions will be disabled.

Attributes

def toApp(apiPath: String, graphiqlPath: Option[String], uploadPath: Option[String], webSocketPath: Option[String])(implicit trace: Trace): IO[ValidationError, HttpApp[R]]

Creates zio-http HttpApp from the GraphQL API

Creates zio-http HttpApp from the GraphQL API

Value parameters

apiPath

The route to serve the API on, e.g., /api/graphql

graphiqlPath

Optionally define a route to serve the GraphiQL UI on, e.g., /graphiql

uploadPath

Optionally define a route to serve file uploads on, e.g., /api/upload

Attributes

def unsafe: UnsafeApi[R]

Unsafe API which allows running the server impurely

Unsafe API which allows running the server impurely

Attributes

Deprecated methods

def handler(implicit trace: Trace): IO[ValidationError, RequestHandler[R, Nothing]]

Attributes

Deprecated
true
def handlerConfigured(config: ExecutionConfiguration)(implicit trace: Trace): IO[ValidationError, RequestHandler[R, Response]]

Attributes

Deprecated
true

Concrete fields

val gql: GraphQL[R]