dagger/types

Types

pub type Client {
  Client(endpoint: String, token: String)
}

Constructors

  • Client(endpoint: String, token: String)
pub type DaggerOp(a) {
  Pure(a)
  Fetch(
    fields: List(Field),
    decoder: decode.Decoder(dynamic.Dynamic),
    next: fn(dynamic.Dynamic) -> DaggerOp(a),
  )
}

Constructors

pub type Field {
  Field(
    name: String,
    args: List(#(String, Value)),
    subfields: List(Field),
  )
}

Constructors

  • Field(
      name: String,
      args: List(#(String, Value)),
      subfields: List(Field),
    )
pub type GraphQLError {
  GraphQLError(message: String, path: List(dynamic.Dynamic))
}

Constructors

pub type QueryError {
  NetworkError(String)
  DecodingError(String)
  ExecutionError(List(GraphQLError))
}

Constructors

  • NetworkError(String)
  • DecodingError(String)
  • ExecutionError(List(GraphQLError))
pub type Try(a) =
  Result(a, QueryError)
pub type Value {
  GString(String)
  GInt(Int)
  GFloat(Float)
  GBool(Bool)
  GList(List(Value))
  GObject(List(#(String, Value)))
  GNull
  GDeferred(DaggerOp(List(Field)))
}

Constructors

  • GString(String)
  • GInt(Int)
  • GFloat(Float)
  • GBool(Bool)
  • GList(List(Value))
  • GObject(List(#(String, Value)))
  • GNull
  • GDeferred(DaggerOp(List(Field)))

    GDeferred permette di annidare un’operazione che restituisce una lista di campi (ovvero un oggetto Dagger come Directory o Container) come argomento.

Values

pub fn bind(
  op: DaggerOp(a),
  callback: fn(a) -> DaggerOp(b),
) -> DaggerOp(b)
pub fn continue(
  op: DaggerOp(a),
  callback: fn(a) -> DaggerOp(b),
) -> DaggerOp(b)
pub fn get_query(op: DaggerOp(List(Field))) -> List(Field)
pub fn make_path(fields: List(Field)) -> List(String)
pub fn nest(fields: List(Field)) -> List(Field)
pub fn pure(val: a) -> DaggerOp(a)
pub fn serialize(fields: List(Field)) -> String
Search Document