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 check(query: String)(implicit trace: Trace): IO[CalibanError, Unit]
Parses and validates the provided query against this API.
Parses and validates the provided query against this API.
- query
a string containing the GraphQL query.
- returns
an effect that either fails with a CalibanError or succeeds with
Unit
- abstract def executeRequest(request: GraphQLRequest)(implicit trace: Trace): URIO[R, GraphQLResponse[E]]
Parses, validates and finally runs the provided request against this interpreter.
Parses, validates and finally runs the provided request against this interpreter.
- request
a GraphQL request
- 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]) @HotSpotIntrinsicCandidate() @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def execute(query: String, operationName: Option[String] = None, variables: Map[String, InputValue] = Map(), extensions: Map[String, InputValue] = Map())(implicit trace: Trace): 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 map of variables
- extensions
a map of extensions
- returns
an effect that either fails with an
E
or succeeds with a ResponseValue
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @HotSpotIntrinsicCandidate() @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @HotSpotIntrinsicCandidate() @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
- @HotSpotIntrinsicCandidate() @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @HotSpotIntrinsicCandidate() @native()
- final def provideEnvironment(r: => ZEnvironment[R]): GraphQLInterpreter[Any, E]
Provides the interpreter with its required environment, which eliminates its dependency on
R
. - final def provideLayer[E1 >: E, R0](layer: => ZLayer[R0, E1, R]): GraphQLInterpreter[R0, E1]
Provides a layer to this interpreter, which translates it to another level.
- final def provideSomeLayer[R0]: ProvideSomeLayer[R0, R, E]
Splits the environment into two parts, providing one part using the specified layer and leaving the remainder
R0
. - final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- 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 wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- 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
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated
(Since version 9)