object QueryCompiler
- Source
- compiler.scala
- Alphabetic
- By Inheritance
- QueryCompiler
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
- class ComponentElaborator[F[_]] extends Phase
A compiler phase which partitions a query for execution by multiple composed mappings.
A compiler phase which partitions a query for execution by multiple composed mappings.
This phase transforms the input query by assigning subtrees to component mappings as specified by the supplied
cmapping
.The mapping has
Type
and field name pairs as keys and mapping and join function pairs as values. When the traversal of the input query visits aSelect
node with typeType.field name
it will replace theSelect
with aComponent
node comprising,1. the mapping which will be responsible for evaluating the subquery. 2. A join function which will be called during interpretation with,
i) The deferred subquery. ii) the cursor at that point in evaluation.
This join function is responsible for computing the continuation query which will be evaluated by the responsible interpreter.
Because the join is provided with the cursor of the parent interpreter the subquery can be parameterised with values derived from the parent query.
- class EffectElaborator[F[_]] extends Phase
A compiler phase which partitions a query for execution which may invoke multiple effect handlers.
A compiler phase which partitions a query for execution which may invoke multiple effect handlers.
This phase transforms the input query by assigning subtrees to effect handlers as specified by the supplied
emapping
.The mapping has
Type
and field name pairs as keys and effect handlers as values. When the traversal of the input query visits aSelect
node with typeType.field name
it will replace theSelect
with anEffect
node comprising,1. the effect handler which will be responsible for running the effect and evaluating the subquery against its result. 2. the subquery which will be evaluated by the effect handler.
- type Elab[T] = IndexedStateT[Result, ElabState, ElabState, T]
Elaboration monad.
Elaboration monad.
Supports threading of state through the elaboration of a query. Provides, + access to the schema, context, variables and fragments of a query. + ability to transform the children of Selects to supply semantics for field arguments. + ability to add contextual data to the resulting query both to support propagation of context to the elaboration of children, and to to drive run time behaviour. + ability to add selects for additional attributes to the resulting query. + ability to test existence and properties of neighbour nodes of the node being elaborated. + ability to report errors and warnings during elaboration.
- case class ElabState(parent: Option[ElabState], schema: Schema, context: Context, vars: Vars, fragments: Map[String, UntypedFragment], query: Query, localEnv: Env, attributes: List[(String, Query)], childTransform: (Query) => Elab[Query]) extends Product with Serializable
The state managed by the elaboration monad.
- class IntrospectionElaborator extends Phase
A phase which elaborates GraphQL introspection queries into the query algrebra.
- sealed trait IntrospectionLevel extends AnyRef
- trait Phase extends AnyRef
A QueryCompiler phase.
- class QuerySizeValidator extends Phase
A compiler phase which estimates the size of a query and applies width and depth limits.
- trait SelectElaborator extends Phase
A compiler phase which translates
Select
nodes to be directly interpretable.A compiler phase which translates
Select
nodes to be directly interpretable.This phase,
1. types bindings according to the schema: i) untyped enums are validated and typed according to their declared type. ii) String and Int bindings are translated to ID bindings where appropriate. iii) default values are supplied for missing arguments. iv) arguments are permuted into the order declared in the schema.
2. eliminates Select arguments by delegating to a model-specific
PartialFunction
which is responsible for translatingSelect
nodes into a form which is directly interpretable, for example, replacing them with aFilter
orUnique
node with aPredicate
which is parameterized by the arguments, ie.,
might be translated to,UntypedSelect("character", None, List(IDBinding("id", "1000")), Nil, child)
3. GraphQL introspection query field arguments are elaborated.Select("character, None, Filter(FieldEquals("id", "1000"), child))
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- object ComponentElaborator
- object EffectElaborator
- object Elab
- object IntrospectionElaborator
- object IntrospectionLevel
- object SelectElaborator
- object VariablesSkipAndFragmentElaborator extends Phase
A phase which elaborates variables, directives, fragment spreads and inline fragments.
A phase which elaborates variables, directives, fragment spreads and inline fragments.
1. Query variable values are substituted for all variable references.
2.
skip
andinclude
directives are handled during this phase and the guarded subqueries are retained or removed as appropriate.3. Fragment spread and inline fragments are expanded.
4. types narrowing coercions by resolving the target type against the schema.
5. verifies that leaves have an empty subselection set and that structured types have a non-empty subselection set.