Skip to content

Commit

Permalink
sangria-marshalling-api v1.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
OlegIlyenko committed May 11, 2018
1 parent a3fbeb2 commit f432c24
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
8 changes: 4 additions & 4 deletions src/main/scala/sangria/execution/ResultResolver.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down

0 comments on commit f432c24

Please sign in to comment.