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]
- Alphabetic
- By Inheritance
- GraphQLInterpreter
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Abstract Value Members
- 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
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##(): Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- 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 typeE2
- returns
a new GraphQL interpreter with error type
E2
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- 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
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- 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]]
toURIO[R2, GraphQLResponse[E2]]
- returns
a new GraphQL interpreter