Skip to content

Instantly share code, notes, and snippets.

@OlegIlyenko
Created April 19, 2018 19:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save OlegIlyenko/31be660663d8b86d7e7b83c5e76563f9 to your computer and use it in GitHub Desktop.
Save OlegIlyenko/31be660663d8b86d7e7b83c5e76563f9 to your computer and use it in GitHub Desktop.
useful for exception handlers
import sangria.marshalling.MarshallingUtil._
import sangria.marshalling.circe._
val marchaller: ResultMarshaller = ??? // provided in ExceptionHandler
val json: Json = ??? // your custom json
implicit val mForType = SimpleResultMarshallerForType[marchaller.Node](marchaller)
val converted: marchaller.Node = json.convertMarshaled[marchaller.Node]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment