Skip to content

Commit

Permalink
adds unit encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
roryc89 committed Apr 22, 2024
1 parent 7f85c4d commit 481e3dc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/GraphQL/Hasura/Decode.purs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ type Err a = Either JsonDecodeError a
class DecodeHasura a where
decodeHasura :: Json -> Either JsonDecodeError a

instance decodeHasuraUnit :: DecodeHasura Unit where
decodeHasura = decodeJson

instance decodeHasuraBoolean :: DecodeHasura Boolean where
decodeHasura = decodeJson

Expand Down
3 changes: 3 additions & 0 deletions src/GraphQL/Hasura/Encode.purs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ import Unsafe.Coerce (unsafeCoerce)
class EncodeHasura a where
encodeHasura :: a -> Json

instance encodeHasuraUnit :: EncodeHasura Unit where
encodeHasura = encodeJson

instance encodeHasuraBoolean :: EncodeHasura Boolean where
encodeHasura = encodeJson

Expand Down

0 comments on commit 481e3dc

Please sign in to comment.