-
-
Notifications
You must be signed in to change notification settings - Fork 251
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Play support #234
Play support #234
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added some initial feedback. An example like the http4s/akka ones would be nice. And to update the docs but this can be done at the end.
Also, the WebSocket part can be done in a later PR if you want.
Also, I have never used Play so maybe @paulpdaniels and @fagossa can give more feedback. |
- Dependencies for 2.7 and 2.8 - Json codecs for caliban datatypes - Controller
runtime | ||
.unsafeRunToFuture( | ||
interpreter | ||
.execute(req.body.query, req.body.operationName, req.body.variables.getOrElse(Map.empty)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Potential follow up areas: supporting the persisted-query and the file upload specs.
li => Json.obj("locations" -> Json.arr(Json.obj("line" -> li.line, "column" -> li.column))) | ||
|
||
private def encodeLocationInfoAndMessage(li: Option[LocationInfo], message: String) = | ||
li.fold(Json.obj())(li => Json.obj("locations" -> li)) ++ Json.obj("message" -> message) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can simplify to Json.obj("message" -> message, "locations" -> li)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Edit: 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On second thought, it does change the behavior however trivial it is. I feel better leaving it behave the same with circe, wdyt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does the behavior change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually why does the locationinfo writes also pass it’s key name?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the catch!
I meant your simplification would add field "locations": null
, when LocationInfo
is empty, where currently it drops the key altogether.
Current circe impl drops the null values.
This change needs to be applied in this adapter too. |
@yoohaemin Hi! |
Closing this one as most code related to play-json has been merged already. The issue remains open for creating the adapter part. |
close #143
todo