diff --git a/CHANGELOG.md b/CHANGELOG.md index 13608618..15c84f9d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ * Fixed new line tracking when parsing block-strings * Ast schema builder now considers `additionalTypes` when it validates the type extensions * `KnownDirectives` validation now correctly handles type and schema extensions +* Updated `sangria-marshalling-api` to version 1.0.3 (should be backwards compatible with v1.0.0). ## v1.4.0 (2018-02-20) diff --git a/build.sbt b/build.sbt index 88ebd83e..b4261610 100644 --- a/build.sbt +++ b/build.sbt @@ -31,7 +31,7 @@ libraryDependencies ++= Seq( "org.sangria-graphql" %% "macro-visit" % "0.1.1", // Marshalling - "org.sangria-graphql" %% "sangria-marshalling-api" % "1.0.2", + "org.sangria-graphql" %% "sangria-marshalling-api" % "1.0.3", // Streaming "org.sangria-graphql" %% "sangria-streaming-api" % "1.0.0", diff --git a/src/main/scala/sangria/execution/ResultResolver.scala b/src/main/scala/sangria/execution/ResultResolver.scala index cf37ceb8..68de6049 100644 --- a/src/main/scala/sangria/execution/ResultResolver.scala +++ b/src/main/scala/sangria/execution/ResultResolver.scala @@ -72,9 +72,9 @@ class ResultResolver(val marshaller: ResultMarshaller, exceptionHandler: Excepti case _ ⇒ Nil } - private def createLocation(loc: AstLocation) = marshaller.map( - "line" → marshaller.fromInt(loc.line), - "column" → marshaller.fromInt(loc.column)) + private def createLocation(loc: AstLocation) = marshaller.mapNode(Seq( + "line" → marshaller.scalarNode(loc.line, "Int", Set.empty), + "column" → marshaller.scalarNode(loc.column, "Int", Set.empty))) private def errorNode(message: String, path: ExecutionPath, positions: List[AstLocation], additionalFields: Seq[(String, marshaller.Node)] = Nil, additionalExtensionFields: Seq[(String, marshaller.Node)] = Nil): marshaller.Node = mapNode( @@ -90,7 +90,7 @@ class ResultResolver(val marshaller: ResultMarshaller, exceptionHandler: Excepti }) private def messageFields(message: String): Seq[(String, marshaller.Node)] = - Seq("message" → marshaller.fromString(message)) + Seq("message" → marshaller.scalarNode(message, "String", Set.empty)) private def pathFields(path: ExecutionPath): Seq[(String, marshaller.Node)] = if (path.nonEmpty) diff --git a/src/test/scala/sangria/execution/ExceptionHandlingSpec.scala b/src/test/scala/sangria/execution/ExceptionHandlingSpec.scala index a34a3c63..9fb1e74e 100644 --- a/src/test/scala/sangria/execution/ExceptionHandlingSpec.scala +++ b/src/test/scala/sangria/execution/ExceptionHandlingSpec.scala @@ -6,6 +6,7 @@ import sangria.schema._ import sangria.macros._ import sangria.util.{DebugUtil, FutureResultSupport, OutputMatchers, StringMatchers} import sangria.validation.{AstNodeLocation, BadValueViolation, BaseViolation, UndefinedFieldViolation} +import sangria.marshalling.MarshallingUtil._ import scala.concurrent.Future import scala.util.{Failure, Success}