QueryInterpreter

class QueryInterpreter[F[_]](mapping: Mapping[F])
Companion:
object
class Object
trait Matchable
class Any

Value members

Concrete methods

def cursorCompatible(tpe: Type, cursorTpe: Type): Boolean
def run(query: Query, rootTpe: Type, env: Env): Stream[F, Json]

Interpret query with expected type rootTpe.

Interpret query with expected type rootTpe.

The query is fully interpreted, including deferred or staged components.

The resulting Json value should include standard GraphQL error information in the case of failure.

def runFields(query: Query, tpe: Type, cursor: Cursor): Result[List[(String, ProtoJson)]]

Interpret query against cursor, yielding a collection of fields.

Interpret query against cursor, yielding a collection of fields.

If the query is valid, the field subqueries will all be valid fields of the enclosing type tpe and the resulting fields may be used to build a Json object of type tpe. If the query is invalid errors will be returned on the left hand side of the result.

def runList(query: Query, tpe: Type, cursors: List[Cursor], f: Kleisli[Result, List[Cursor], List[Cursor]]): Result[ProtoJson]
def runRoot(query: Query, rootTpe: Type, env: Env): Stream[F, Result[Json]]

Interpret query with expected type rootTpe.

Interpret query with expected type rootTpe.

The query is fully interpreted, including deferred or staged components.

Errors are accumulated on the Left of the result.

def runRootValue(query: Query, rootTpe: Type, env: Env): Stream[F, Result[ProtoJson]]
def runRootValue0(query: Query, context: Context, env: Env): Stream[F, Result[ProtoJson]]

Interpret query with expected type rootTpe.

Interpret query with expected type rootTpe.

At most one stage will be run and the result may contain deferred components.

Errors are accumulated on the Left of the result.

def runRootValues(queries: List[(Query, Type, Env)]): Stream[F, (Chain[Problem], List[ProtoJson])]

Interpret multiple queries with respect to their expected types.

Interpret multiple queries with respect to their expected types.

Each query is interpreted with respect to the expected type it is paired with. The result list is aligned with the argument list query list. For each query at most one stage will be run and the corresponding result may contain deferred components.

Errors are aggregated across all the argument queries and are accumulated on the Left of the result.

This method is typically called at the end of a stage to evaluate deferred subqueries in the result of that stage. These will be grouped by and passed jointly to the responsible interpreter in the next stage using this method. Interpreters which are able to benefit from combining queries may do so by overriding this method to implement their specific combinging logic.

def runValue(query: Query, tpe: Type, cursor: Cursor): Result[ProtoJson]

Interpret query against cursor with expected type tpe.

Interpret query against cursor with expected type tpe.

If the query is invalid errors will be returned on the left hand side of the result.