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.
- Companion
- object
Value members
Abstract methods
Parses and validates the provided query against this API.
Parses and validates the provided query against this API.
- Value Params
- query
a string containing the GraphQL query.
- 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 Params
- enableIntrospection
returns an error for introspection queries when false
- queryExecution
a strategy for executing queries in parallel or not
- request
a GraphQL request
- skipValidation
skips the validation step if true
- 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 Params
- enableIntrospection
returns an error for introspection queries when false
- extensions
a map of extensions
- operationName
the operation to run in case the query contains multiple operations
- query
a string containing the GraphQL query
- queryExecution
a strategy for executing queries in parallel or not
- skipValidation
skips the validation step if true
- variables
a map of variables
- 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 Params
- f
a function from the current error type
E
to another typeE2
- 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
.
Provides the part of the environment that is not part of the ZEnv
,
leaving a query that only depends on the ZEnv
.
Provides the part of the environment that is not part of the ZEnv
,
leaving a query that only depends on the ZEnv
.
Provides a layer to this interpreter, which translates it to another level.
Provides a layer to this interpreter, which translates it to another level.
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
.
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 Params
- f
a function from
URIO[R, GraphQLResponse[E]]
toURIO[R2, GraphQLResponse[E2]]
- Returns
a new GraphQL interpreter