Packages

object SchemaShape extends Serializable

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

Type Members

  1. final case class DiscoveryState[F[_]](toplevels: Map[String, Toplevel[F, _]], implementations: Implementations[F], positions: Map[String, List[Position[F, _]]]) extends Product with Serializable
  2. type Implementations[F[_]] = Map[String, Map[String, InterfaceImpl[F, _]]]
  3. sealed trait InterfaceImpl[+F[_], A] extends AnyRef
  4. final class PartiallyAppliedSchemaShape[F[_]] extends AnyVal
  5. sealed trait VisitNode[+F[_]] extends AnyRef
  6. sealed trait __TypeKind extends Product with Serializable

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 discover[F[_]](shape: SchemaShape[F, _, _, _]): DiscoveryState[F]
  7. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  8. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  9. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  10. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  11. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  12. def introspect[F[_]](ss: SchemaShape[F, _, _, _]): NonEmptyList[(String, Field[F, Unit, _])]
  13. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  14. def make[F[_]]: PartiallyAppliedSchemaShape[F]
  15. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  16. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  17. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  18. def render[F[_]](shape: SchemaShape[F, _, _, _]): String
  19. def renderValueDoc[C](v: Value[AnyValue, C]): Doc
  20. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  21. def toString(): String
    Definition Classes
    AnyRef → Any
  22. def unit[F[_]](query: NonEmptyList[(String, Field[F, Unit, _])], mutation: Option[NonEmptyList[(String, Field[F, Unit, _])]] = None, subscription: Option[NonEmptyList[(String, Field[F, Unit, _])]] = None, outputTypes: List[OutToplevel[F, _]] = Nil, inputTypes: List[InToplevel[_]] = Nil): SchemaShape[F, Unit, Unit, Unit]
  23. def visit[F[_], G[_], A](root: SchemaShape[F, _, _, _])(pf: PartialFunction[VisitNode[F], (G[A]) => G[A]])(implicit arg0: Monad[G], arg1: Parallel[G], D0: Defer[G], M: Monoid[A]): G[A]

    A powerful fold over the schema.

    A powerful fold over the schema. This functions lets the caller choose how to handle recursion explicitly, which allows Kleisli algebras (Local) to be possible.

    For instance, counting the number of fields from parent to leaf:

    case class State(leaf: String, fields: Int)
    type G[A] = Kleisli[WriterT[Eval, List[State], *], Int, A]
    val G = Monad[G]
    val L = Local[G, Int]
    val T = Tell[G, List[State]]
    
    object & {
      def unapply[A](a: A): Option[(A, A)] = Some((a, a))
    }
    
    val states: List[State] = ScheamShape.visit[F, G](schema) {
      case VisitNode.FieldNode(_, _) => (rec: G[Unit]) => L.local(rec)(_ + 1)
      case VisitNode.OutNode((_: Scalar[?] | _: Enum[?]) & tl: Toplevel[F, ?]) => rec =>
        L.ask[Int].flatMap(i => T.tell(List(State(tl.name, i)))) >> rec
    }.run(0).run.written.value

    Consider that if we used state without being explicit about the recursion, we wouldn't be able to "pop" the field count.

    An idiomatic combinator name may be parRecFoldMapM

  24. def visitOnce[F[_], G[_], A](root: SchemaShape[F, _, _, _])(pf: PartialFunction[VisitNode[F], G[A]])(implicit arg0: Monad[G], arg1: Defer[G], A: Monoid[A]): G[A]
  25. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  26. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  27. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  28. object InterfaceImpl
  29. object VisitNode
  30. object __TypeKind extends Serializable

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped