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.
Attributes
- Companion
- object
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
Members list
Value members
Abstract methods
Parses and validates the provided query against this API.
Parses and validates the provided query against this API.
Value parameters
- query
-
a string containing the GraphQL query.
Attributes
- Returns
-
an effect that either fails with a CalibanError or succeeds with
Unit
Parses, validates and finally runs the provided request against this interpreter.
Parses, validates and finally runs the provided request against this interpreter.
Value parameters
- request
-
a GraphQL request
Attributes
- Returns
-
an effect that either fails with an
E
or succeeds with a ResponseValue
Concrete methods
Parses, validates and finally runs the provided query against this interpreter.
Parses, validates and finally runs the provided query against this interpreter.
Value parameters
- extensions
-
a map of extensions
- operationName
-
the operation to run in case the query contains multiple operations
- query
-
a string containing the GraphQL query
- variables
-
a map of variables
Attributes
- Returns
-
an effect that either fails with an
E
or succeeds with a ResponseValue
Changes the error channel of the execute
method. This can be used to customize error messages.
Changes the error channel of the execute
method. This can be used to customize error messages.
Value parameters
- f
-
a function from the current error type
E
to another typeE2
Attributes
- Returns
-
a new GraphQL interpreter with error type
E2
Provides the interpreter with its required environment, which eliminates its dependency on R
.
Provides the interpreter with its required environment, which eliminates its dependency on R
.
Attributes
Provides a layer to this interpreter, which translates it to another level.
Provides a layer to this interpreter, which translates it to another level.
Attributes
Splits the environment into two parts, providing one part using the specified layer and leaving the remainder R0
.
Splits the environment into two parts, providing one part using the specified layer and leaving the remainder R0
.
Attributes
Wraps the execute
method of the interpreter with the given function. This can be used to customize errors, add global timeouts or logging functions.
Wraps the execute
method of the interpreter with the given function. This can be used to customize errors, add global timeouts or logging functions.
Value parameters
- f
-
a function from
URIO[R, GraphQLResponse[E]]
toURIO[R2, GraphQLResponse[E2]]
Attributes
- Returns
-
a new GraphQL interpreter