noahzgordon/elm-jsonapi/1.0.0

NOTE: this package is not compatible with Elm 0.19.1

JsonApi.Documents

Helper functions for working with a full JsonApi Document

Common Helpers

jsonapi : Document -> Maybe JsonApiObject

Fetch information from the top-level 'jsonapi' object

primaryResource : Document -> Result String Resource

Retrieve the primary resource from a decoded Document. This function assumes a singular primary resource.

primaryResourceCollection : Document -> Result String (List Resource)

Retrieve the primary resource from a decoded Document. This function assumes a singular primary resource.

meta : Document -> Meta

Fetch the top-level meta object from the document.