sangria-graphql / sangria-msgpack   2.0.1

Apache License 2.0 GitHub

Sangria MessagePack marshalling.

Scala versions: 3.x 2.13 2.12 2.11

Sangria MessagePack marshalling.

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

SBT Configuration:

libraryDependencies += "org.sangria-graphql" %% "sangria-msgpack" % "<latest version>"

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.