Skip to content

Commit

Permalink
Release v0.4.4
Browse files Browse the repository at this point in the history
  • Loading branch information
OlegIlyenko committed May 1, 2016
1 parent 58b5606 commit c8473ac
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,7 @@
## v0.4.4 (2016-05-01)

* Updated to sangria-marshalling-api v0.2.1

## v0.4.3 (2016-04-11)

* Updated `circe` to version 0.4.1
Expand Down
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -5,7 +5,7 @@
SBT Configuration:

```scala
libraryDependencies += "org.sangria-graphql" %% "sangria-circe" % "0.4.3"
libraryDependencies += "org.sangria-graphql" %% "sangria-circe" % "0.4.4"
```

## License
Expand Down
6 changes: 3 additions & 3 deletions build.sbt
@@ -1,6 +1,6 @@
name := "sangria-circe"
organization := "org.sangria-graphql"
version := "0.4.4-SNAPSHOT"
version := "0.4.4"

description := "Sangria circe marshalling"
homepage := Some(url("http://sangria-graphql.org"))
Expand All @@ -12,12 +12,12 @@ scalacOptions ++= Seq("-deprecation", "-feature")
val circeVersion = "0.4.1"

libraryDependencies ++= Seq(
"org.sangria-graphql" %% "sangria-marshalling-api" % "0.2.0",
"org.sangria-graphql" %% "sangria-marshalling-api" % "0.2.1",

"io.circe" %% "circe-core" % circeVersion,
"io.circe" %% "circe-generic" % circeVersion,

"org.sangria-graphql" %% "sangria-marshalling-testkit" % "0.2.0" % "test",
"org.sangria-graphql" %% "sangria-marshalling-testkit" % "0.2.1" % "test",
"org.scalatest" %% "scalatest" % "2.2.6" % "test"
)

Expand Down
14 changes: 14 additions & 0 deletions src/main/scala/sangria/marshalling/circe.scala
Expand Up @@ -20,6 +20,20 @@ object circe {
case None nullNode
}

def scalarNode(value: Any, typeName: String, info: Set[ScalarValueInfo]) = value match {
case v: String Json.fromString(v)
case v: Boolean Json.fromBoolean(v)
case v: Int Json.fromInt(v)
case v: Long Json.fromLong(v)
case v: Float Json.fromDouble(v).get
case v: Double Json.fromDouble(v).get
case v: BigInt Json.fromBigInt(v)
case v: BigDecimal Json.fromBigDecimal(v)
case v throw new IllegalArgumentException("Unsupported scalar value: " + v)
}

def enumNode(value: String, typeName: String) = Json.fromString(value)

def booleanNode(value: Boolean) = Json.fromBoolean(value)
def floatNode(value: Double) = Json.fromDouble(value).get
def stringNode(value: String) = Json.fromString(value)
Expand Down

0 comments on commit c8473ac

Please sign in to comment.