sangria-graphql-org / sangria-msgpack   2.0.0

Apache License 2.0 GitHub

Sangria MessagePack marshalling.

Scala versions: 2.11

Sangria MessagePack marshalling.

Build Status Coverage Status Maven Central License Join the chat at https://gitter.im/sangria-graphql/sangria

SBT Configuration:

libraryDependencies += "org.sangria-graphql" %% "sangria-msgpack" % "1.0.0"

BigDecimal handling

MessagePack does not support BigDecimal natively. However it supports extension types.

In order to provide BigDecimal support, sangria-msgpack implements an extension type with type ID 47. It packs the scale in the first 4 bytes (int) followed by unscaled big integers value. This is the default behaviour, so you don't need any addition import for it.

If you would like to allow sangria-msgpack to pack BigDecimal values as standard types (big integer and double), then you need to add following import:

import sangria.marshalling.msgpack.standardTypeBigDecimal._

Please use it with caution because it will throw IllegalArgumentException if number does not fit in big integer or double.

License

sangria-msgpack is licensed under Apache License, Version 2.0.