Skip to content

Commit

Permalink
Release v0.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
OlegIlyenko committed Mar 24, 2016
1 parent 9ca6f9d commit 19eb3b0
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## v0.4.0 (2016-03-24)

* Updated to sangria-marshalling-api v0.2.0

## v0.3.1 (2016-02-28)

* Updated to latest version of marshalling API
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
SBT Configuration:

```scala
libraryDependencies += "org.sangria-graphql" %% "sangria-circe" % "0.3.1"
libraryDependencies += "org.sangria-graphql" %% "sangria-circe" % "0.4.0"
```

## License
Expand Down
8 changes: 4 additions & 4 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
name := "sangria-circe"
organization := "org.sangria-graphql"
version := "0.3.2-SNAPSHOT"
version := "0.4.0"

description := "Sangria circe marshalling"
homepage := Some(url("http://sangria-graphql.org"))
licenses := Seq("Apache License, ASL Version 2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0"))

scalaVersion := "2.11.7"
scalaVersion := "2.11.8"
scalacOptions ++= Seq("-deprecation", "-feature")

val circeVersion = "0.3.0"

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

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

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

Expand Down
7 changes: 5 additions & 2 deletions src/main/scala/sangria/marshalling/circe.scala
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,13 @@ import cats.data.Xor.{Right, Left}
object circe {
implicit object CirceResultMarshaller extends ResultMarshaller {
type Node = Json
type MapBuilder = ArrayMapBuilder[Node]

def emptyMapNode = Json.obj()
def emptyMapNode(keys: Seq[String]) = new ArrayMapBuilder[Node](keys)
def addMapNodeElem(builder: MapBuilder, key: String, value: Node, optional: Boolean) = builder.add(key, value)

def mapNode(builder: MapBuilder) = Json.obj(builder.toSeq: _*)
def mapNode(keyValues: Seq[(String, Json)]) = Json.obj(keyValues: _*)
def addMapNodeElem(node: Json, key: String, value: Json, optional: Boolean) = node.mapObject(_ add (key, value))

def arrayNode(values: Vector[Json]) = Json.array(values: _*)
def optionalArrayNodeValue(value: Option[Json]) = value match {
Expand Down

0 comments on commit 19eb3b0

Please sign in to comment.