Packages

t

caliban

GraphQLInterpreter

trait GraphQLInterpreter[-R, +E] extends AnyRef

A GraphQLInterpreter[-R, +E] represents a GraphQL interpreter whose execution requires a ZIO environment of type R and can fail with an E.

It is a wrapper around a GraphQL API definition that allows adding some middleware around query execution, and possibly transform the environment or the error type.

Self Type
GraphQLInterpreter[R, E]
Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. GraphQLInterpreter
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Abstract Value Members

  1. abstract def execute(query: String, operationName: Option[String] = None, variables: Map[String, InputValue] = Map(), skipValidation: Boolean = false): URIO[R, GraphQLResponse[E]]

    Parses, validates and finally runs the provided query against this interpreter.

    Parses, validates and finally runs the provided query against this interpreter.

    query

    a string containing the GraphQL query.

    operationName

    the operation to run in case the query contains multiple operations.

    variables

    a list of variables.

    skipValidation

    skips the validation step if true

    returns

    an effect that either fails with an E or succeeds with a ResponseValue

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  6. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  7. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  8. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  9. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  10. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  11. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  12. final def mapError[E2](f: (E) => E2): GraphQLInterpreter[R, E2]

    Changes the error channel of the execute method.

    Changes the error channel of the execute method. This can be used to customize error messages.

    f

    a function from the current error type E to another type E2

    returns

    a new GraphQL interpreter with error type E2

  13. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  14. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  15. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  16. final def provide(r: R): GraphQLInterpreter[Any, E]

    Eliminates the ZIO environment R requirement of the interpreter.

    Eliminates the ZIO environment R requirement of the interpreter.

    r

    a value of type R

    returns

    a new GraphQL interpreter with R = Any

  17. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  18. def toString(): String
    Definition Classes
    AnyRef → Any
  19. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  20. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  21. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  22. final def wrapExecutionWith[R2, E2](f: (URIO[R, GraphQLResponse[E]]) => URIO[R2, GraphQLResponse[E2]]): GraphQLInterpreter[R2, E2]

    Wraps the execute method of the interpreter with the given function.

    Wraps the execute method of the interpreter with the given function. This can be used to customize errors, add global timeouts or logging functions.

    f

    a function from URIO[R, GraphQLResponse[E]] to URIO[R2, GraphQLResponse[E2]]

    returns

    a new GraphQL interpreter

Inherited from AnyRef

Inherited from Any

Ungrouped