abstract class Mapping[F[_]] extends AnyRef

Represents a mapping between a GraphQL schema and an underlying abstract data source.

Source
mapping.scala
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Mapping
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new Mapping()

Type Members

  1. case class CursorField[T](fieldName: String, f: (Cursor) => Result[T], encoder: Encoder[T], required: List[String], hidden: Boolean)(implicit pos: SourcePos) extends FieldMapping with Product with Serializable
  2. case class Delegate(fieldName: String, mapping: Mapping[F], join: (Query, Cursor) => Result[Query] = ComponentElaborator.TrivialJoin)(implicit pos: SourcePos) extends FieldMapping with Product with Serializable
  3. case class EffectField(fieldName: String, handler: EffectHandler[F], required: List[String] = Nil, hidden: Boolean = false)(implicit pos: SourcePos) extends EffectMapping with Product with Serializable
  4. trait EffectMapping extends FieldMapping

    Abstract type of field mappings with effects.

  5. trait FieldMapping extends Product with Serializable
  6. case class FieldTransformCursor[T](underlying: Cursor, f: (T) => Result[T])(implicit evidence$2: ClassTag[T], evidence$3: TypeName[T]) extends ProxyCursor with Product with Serializable

    Proxy Cursor which applies a function to the focus of an underlying LeafCursor.

  7. case class LeafCursor(context: Context, focus: Any, parent: Option[Cursor], env: Env) extends Cursor with Product with Serializable

    Cursor positioned at a GraphQL result leaf

  8. trait LeafMapping[T] extends TypeMapping
  9. abstract class ObjectMapping extends TypeMapping
  10. case class PrefixedMapping(tpe: Type, mappings: List[(List[String], ObjectMapping)])(implicit pos: SourcePos) extends TypeMapping with Product with Serializable
  11. case class PrimitiveField(fieldName: String, hidden: Boolean = false)(implicit pos: SourcePos) extends FieldMapping with Product with Serializable
  12. case class PrimitiveMapping(tpe: Type)(implicit pos: SourcePos) extends TypeMapping with Product with Serializable
  13. case class RootCursor(context: Context, parent: Option[Cursor], env: Env) extends AbstractCursor with Product with Serializable

    Root Cursor focussed on the top level operation of a query

    Root Cursor focussed on the top level operation of a query

    Construction of mapping-specific cursors is handled by delegation to mkCursorForField which is typically overridden in Mapping subtypes.

  14. case class RootEffect extends EffectMapping with Product with Serializable

    Root effects can perform an intial effect prior to computing the resulting Cursor and effective Query.

    Root effects can perform an intial effect prior to computing the resulting Cursor and effective Query.

    These effects are used to perform initial effectful setup for a query or to perform the effect associated with a GraphQL mutation. Convenience methods are provided to cover the cases where only one of the query or the cursor are computed.

    If only the query is computed the default root cursor for the mapping will be used. If only the cursor is computed the client query (after elaboration) is used unmodified ... in this case results of the performed effect can only be passed to the result construction stage via the environment associated with the returned cursor.

  15. case class RootStream extends EffectMapping with Product with Serializable

    Root streams can perform an intial effect prior to emitting the resulting cursors and effective queries.

    Root streams can perform an intial effect prior to emitting the resulting cursors and effective queries.

    Stream effects are used for GraphQL subscriptions. Convenience methods are provided to cover the cases where only one of the query or the cursor are computed

    If only the query is computed the default root cursor for the mapping will be used. If only the cursor is computed the client query (after elaboration) is used unmodified ... in this case results of the performed effect can only be passed to the result construction stage via the environment associated with the returned cursor.

  16. trait TypeMapping extends Product with Serializable

Abstract Value Members

  1. implicit abstract val M: MonadThrow[F]
  2. abstract val schema: Schema
  3. abstract val typeMappings: List[TypeMapping]

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  6. def combineAndRun(queries: List[(Query, Cursor)]): F[Result[List[ProtoJson]]]

    Combine and execute multiple queries.

    Combine and execute multiple queries.

    Each query is interpreted in the context of the Cursor it is paired with. The result list is aligned with the argument 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 mapping in the next stage using this method. Maappongs which are able to benefit from combining queries may do so by overriding this method to implement their specific combinging logic.

  7. def compileAndRun(text: String, name: Option[String] = None, untypedVars: Option[Json] = None, introspectionLevel: IntrospectionLevel = Full, env: Env = Env.empty)(implicit sc: Compiler[F, F]): F[Json]

    Compile and run a single GraphQL query or mutation.

    Compile and run a single GraphQL query or mutation.

    Yields a JSON response containing the result of the query or mutation.

  8. def compileAndRunSubscription(text: String, name: Option[String] = None, untypedVars: Option[Json] = None, introspectionLevel: IntrospectionLevel = Full, env: Env = Env.empty): Stream[F, Json]

    Compile and run a GraphQL subscription.

    Compile and run a GraphQL subscription.

    Yields a stream of JSON responses containing the results of the subscription.

  9. lazy val compiler: QueryCompiler
  10. def compilerPhases: List[Phase]
  11. lazy val componentElaborator: ComponentElaborator[[_]F[_]]
  12. def defaultRootCursor(query: Query, tpe: Type, parentCursor: Option[Cursor]): F[Result[(Query, Cursor)]]

    Yields a Cursor focused on the top level operation type of the query

  13. lazy val effectElaborator: EffectElaborator[[_]F[_]]
  14. def encoderForLeaf(tpe: Type): Option[Encoder[Any]]

    Yields the Encoder associated with the provided type, if any.

  15. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  16. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  17. def fieldMapping(context: Context, fieldName: String): Option[FieldMapping]

    Yields the FieldMapping associated with fieldName in context, if any.

  18. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  19. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  20. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  21. val interpreter: QueryInterpreter[F]
  22. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  23. def isLeaf(tpe: Type): Boolean

    True if the supplied type is a leaf with respect to the GraphQL schema or mapping, false otherwise.

  24. def leafMapping[T](tpe: Type): Option[LeafMapping[T]]

    Yields the LeafMapping associated with the provided type, if any.

  25. def mkCursorForField(parent: Cursor, fieldName: String, resultName: Option[String]): Result[Cursor]

    Yields a Cursor suitable for traversing the query result corresponding to the fieldName child of parent.

    Yields a Cursor suitable for traversing the query result corresponding to the fieldName child of parent.

    This method is typically overridden in and delegated to by Mapping subtypes.

  26. def mkResponse(result: Result[Json]): F[Json]

    Construct a GraphQL response from a Result.

  27. def mkResponse(data: Option[Json], errors: Chain[Problem]): Json

    Construct a GraphQL response from the possibly absent result data and a collection of errors.

  28. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  29. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  30. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  31. def objectMapping(context: Context): Option[ObjectMapping]

    Yields the ObjectMapping associated with the provided context, if any.

  32. def rootEffect(context: Context, fieldName: String): Option[RootEffect]

    Yields the RootEffect, if any, associated with fieldName.

  33. def rootStream(context: Context, fieldName: String): Option[RootStream]

    Yields the RootStream, if any, associated with fieldName.

  34. val selectElaborator: SelectElaborator
  35. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  36. def toString(): String
    Definition Classes
    AnyRef → Any
  37. def typeMapping(tpe: NamedType): Option[TypeMapping]

    Yields the TypeMapping associated with the provided type, if any.

  38. val validator: MappingValidator
  39. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  40. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  41. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  42. object CursorField extends Serializable
  43. object LeafMapping extends Serializable
  44. object ObjectMapping extends Serializable
  45. object RootEffect extends Serializable
  46. object RootStream extends Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped