Skip to content

Commit

Permalink
chore: doc interpreters
Browse files Browse the repository at this point in the history
  • Loading branch information
ValdemarGr committed Aug 30, 2023
1 parent 7525fda commit 58ad710
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ import gql._
import gql.preparation._
import cats.effect.std.Supervisor

/** The [[QueryInterpreter]] will prepare a query for execution by inspecting the ast and planning the query accordingly.
* Once all inputs have been prepared, the execution AST is passed to the [[SubqueryInterpreter]] for evaluation.
*/
trait QueryInterpreter[F[_]] {
import QueryInterpreter._

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ import gql.preparation._
import fs2.Stream
import scala.concurrent.duration.FiniteDuration

/** The [[StreamInterpreter]] is resposible for:
* - Wireing together results for a query.
* - Handling incoming asynchronous events.
* - Handling resource lifetimes.
*
* For actual query excution, take a look at [[QueryInterpreter]].
*/
trait StreamInterpreter[F[_]] {
import StreamInterpreter._

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ import gql.resolver._
import io.circe.syntax._
import gql._

/** The [[SubqueryInterpreter]] recursively runs through the AST and performs a multitude of tasks:
* - Runs the [[Resolver]]/[[Step]]s defined in the query.
* - Accumulates errors that occur during the evaluation of the query.
* - Logs streams that have been subscribed to.
* - Batches computations that have been marked as batchable.
*/
trait SubqueryInterpreter[F[_]] {
type W[A] = WriterT[F, Chain[EvalFailure], A]

Expand Down

0 comments on commit 58ad710

Please sign in to comment.