driebit/elm-ginger/1.0.0

NOTE: the latest version is 5.0.1

Ginger.Resource

Definitions

type alias Resource a =
{ a
| id : ResourceId
, title : Translation
, body : Translation
, subtitle : Translation
, summary : Translation
, path : String
, category : NonEmpty Category
, properties : Value
, publicationDate : Maybe Posix
, media : Media
, blocks : List Block
}
type alias WithEdges =
{ edges : List Edge }
type alias Edge =
{ predicate : Predicate
, resource : Resource {}
}

A named connection to a resource. The Resource doesn't have any edges because the current Ginger api only includes edges one level deep.

type alias Block =
{ body : Translation
, name : String
, type_ : BlockType
, relatedRscId : Maybe ResourceId
, properties : Value
}
= Text
| Header
| Page
| Custom String

Query

edgesWithPredicate : Predicate -> Resource WithEdges -> List (Resource {})
category : Resource a -> Category
depiction : MediaClass -> Resource WithEdges -> Maybe String
depictions : MediaClass -> Resource WithEdges -> List String

Decode

fromJsonWithEdges : Decoder (Resource WithEdges)
fromJsonWithoutEdges : Decoder (Resource {})