Skip to content

Instantly share code, notes, and snippets.

@grrinchas
Created January 6, 2018 13:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save grrinchas/774b848cbb57f266974b9634407fdd08 to your computer and use it in GitHub Desktop.
Save grrinchas/774b848cbb57f266974b9634407fdd08 to your computer and use it in GitHub Desktop.
decodePosts : Decoder.Decoder (List Post)
decodePosts =
Decoder.list decodePost
|> Decoder.field "allPosts"
|> Decoder.field "data"
decodeGraphcoolToken : Decoder.Decoder String
decodeGraphcoolToken =
Decoder.string
|> Decoder.field "token"
|> Decoder.field "authenticate"
|> Decoder.field "data"
decodePost : Decoder.Decoder Post
decodePost =
Pipeline.decode Post
|> Pipeline.required "id" Decoder.string
|> Pipeline.required "title" Decoder.string
|> Pipeline.required "body" Decoder.string
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment