Packages

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 check(query: String): 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

  2. abstract def executeRequest(request: GraphQLRequest, skipValidation: Boolean = false, enableIntrospection: Boolean = true, queryExecution: QueryExecution = QueryExecution.Parallel): 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

    skipValidation

    skips the validation step if true

    enableIntrospection

    returns an error for introspection queries when false

    queryExecution

    a strategy for executing queries in parallel or not

    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() @HotSpotIntrinsicCandidate()
  6. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  7. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  8. def execute(query: String, operationName: Option[String] = None, variables: Map[String, InputValue] = Map(), extensions: Map[String, InputValue] = Map(), skipValidation: Boolean = false, enableIntrospection: Boolean = true, queryExecution: QueryExecution = QueryExecution.Parallel): 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

    skipValidation

    skips the validation step if true

    enableIntrospection

    returns an error for introspection queries when false

    queryExecution

    a strategy for executing queries in parallel or not

    returns

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

  9. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  10. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  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() @HotSpotIntrinsicCandidate()
  15. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  16. final def provide(r: R)(implicit ev: NeedsEnv[R]): GraphQLInterpreter[Any, E]

    Provides the interpreter with its required environment, which eliminates its dependency on R.

  17. final def provideCustomLayer[E1 >: E, R1 <: Has[_]](layer: ZLayer[zio.ZEnv, E1, R1])(implicit ev: <:<[zio.ZEnv with R1, R], tagged: zio.Tag[R1]): GraphQLInterpreter[zio.ZEnv, E1]

    Provides the part of the environment that is not part of the ZEnv, leaving a query that only depends on the ZEnv.

  18. final def provideLayer[E1 >: E, R0, R1 <: Has[_]](layer: ZLayer[R0, E1, R1])(implicit ev1: <:<[R1, R], ev2: NeedsEnv[R]): GraphQLInterpreter[R0, E1]

    Provides a layer to this interpreter, which translates it to another level.

  19. final def provideSomeLayer[R0 <: Has[_]]: ProvideSomeLayer[R0, R, E]

    Splits the environment into two parts, providing one part using the specified layer and leaving the remainder R0.

  20. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  21. def toString(): String
    Definition Classes
    AnyRef → Any
  22. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  23. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  24. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  25. 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

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

Inherited from AnyRef

Inherited from Any

Ungrouped