Renderer

caliban.rendering.Renderer
See theRenderer companion object
trait Renderer[-A]

The inverse of a Parser over some type A. A renderer can be used to render a value of type A to a string in either a regular or compact format.

For specializations actually relevant to graphql see caliban.rendering.ValueRenderer and caliban.rendering.DocumentRenderer

Attributes

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object DocumentRenderer.type
Self type

Members list

Value members

Concrete methods

def ++[A1 <: A](that: Renderer[A1]): Renderer[A1]

Combines this renderer with another renderer sequentially. Semantically equivalent to this andThen that

Combines this renderer with another renderer sequentially. Semantically equivalent to this andThen that

Attributes

def contramap[B](f: B => A): Renderer[B]

Contramaps the input of this renderer with the given function producing a renderer that now operates on type B

Contramaps the input of this renderer with the given function producing a renderer that now operates on type B

Attributes

def list: Renderer[List[A]]

Returns a renderer that renders a list of A where the underlying renderer is responsible for rendering the separator between each element.

Returns a renderer that renders a list of A where the underlying renderer is responsible for rendering the separator between each element.

Attributes

def list[A1 <: A](separator: Renderer[A1], omitFirst: Boolean): Renderer[List[A1]]

Returns a renderer that renders a list of A but where the separator is rendered by provided argument renderer. The second parameter determines whether to print the separator before the first element or not.

Returns a renderer that renders a list of A but where the separator is rendered by provided argument renderer. The second parameter determines whether to print the separator before the first element or not.

Attributes

def optional: Renderer[Option[A]]

Returns an optional renderer that will only render the value if it is defined

Returns an optional renderer that will only render the value if it is defined

Attributes

def render(a: A): String
def renderCompact(a: A): String
def set[A1 <: A](separator: Renderer[A1]): Renderer[Set[A1]]

Returns a renderer that renders a set of A but where the separator is rendered by provided argument renderer.

Returns a renderer that renders a set of A but where the separator is rendered by provided argument renderer.

Attributes

def when[A1 <: A](pred: A1 => Boolean): Renderer[A1]

Returns a renderer that will only render when the provided predicate is true.

Returns a renderer that will only render when the provided predicate is true.

Attributes