noahzgordon/elm-jsonapi/1.0.0

NOTE: this package is not compatible with Elm 0.19.1

JsonApi.Resources

Helper functions for working with a single JsonApi Resource

Common Helpers

id : Resource -> String

Get the string ID of a Resource

attributes : Resource -> Attributes

Pull the attributes off of a Resource, so that you don't have to do the destructuring yourself.

relatedResource : String -> Resource -> Result String Resource

Find a related resource. Will return an Err if a resource collection is found.

relatedResourceCollection : String -> Resource -> Result String (List Resource)

Find a related collection of resources. Will return an Err if a single resource is found.

meta : Resource -> Meta

Pull the meta value off of a Resource.

relatedMeta : String -> Resource -> Result String Meta

Retreive the meta information from a relationship. Will return an Err if the relationship does not exist.