Wrappers

caliban.wrappers.Wrappers$
object Wrappers

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Concise view

Value members

Concrete methods

def logSlowQueries(duration: Duration): OverallWrapper[Any]

Returns a wrapper that logs slow queries

Returns a wrapper that logs slow queries

Attributes

duration

threshold above which queries are considered slow

def maxDepth(maxDepth: Int): ValidationWrapper[Any]

Returns a wrapper that checks that the query's depth is under a given max

Returns a wrapper that checks that the query's depth is under a given max

Attributes

maxDepth

the max allowed depth

def maxFields(maxFields: Int): ValidationWrapper[Any]

Returns a wrapper that checks that the query has a limited number of fields

Returns a wrapper that checks that the query has a limited number of fields

Attributes

maxFields

the max allowed number of fields

def metrics(totalLabel: String, durationLabel: String, buckets: Boundaries, extraLabels: Set[MetricLabel]): EffectfulWrapper[Any]

Returns a wrapper that adds field metrics to the query

Returns a wrapper that adds field metrics to the query

Attributes

buckets

the buckets to use for the duration metric

durationLabel

the name of the duration metric

extraLabels

extra labels to add to the metrics

totalLabel

the name of the total fields metric

def onSlowQueries[R](duration: Duration)(f: (Duration, String) => URIO[R, Any]): OverallWrapper[R]

Returns a wrapper that runs a given function in case of slow queries

Returns a wrapper that runs a given function in case of slow queries

Attributes

duration

threshold above which queries are considered slow

def printSlowQueries(duration: Duration): OverallWrapper[Any]

Returns a wrapper that prints slow queries

Returns a wrapper that prints slow queries

Attributes

duration

threshold above which queries are considered slow

def timeout(duration: Duration): OverallWrapper[Any]

Returns a wrapper that times out queries taking more than a specified time.

Returns a wrapper that times out queries taking more than a specified time.

Attributes

duration

threshold above which queries should be timed out

Concrete fields

Returns a wrapper that prints errors to the console

Returns a wrapper that prints errors to the console

Attributes