Output Type for JsValue?

74 views
Skip to first unread message

Aaron Patzer

unread,
Feb 22, 2017, 10:09:42 PM2/22/17
to sangria-graphql

In GraphQL, there are circumstances where you may have a large number of derived classes and you want to output the variance as a raw JSON object. I might, for example want to output a mixed bag of Shape objects, each of which is described in a different format, or having a varying number of points/lines/curves.


case class Shape(name: String, points: JsValue)


At present, GraphQL cannot output such an object as:
Can't find suitable GraphQL output type for Option[play.api.libs.json.JsValue]


It seems like this should be easy to do since JsValue is an "already-marshalled" object.

Any suggestions on how to implement?

Reply all
Reply to author
Forward
0 new messages