kyleu / boilerplay

Using the latest technology in the Scala ecosystem, Boilerplay is a reactive web application built on Play Framework, ScalaJS, Silhouette, Sangria/GraphQL, and PostgreSQL. It provides a good starting point for whatever you want to build.

Home Page:https://kyleu.github.io/boilerplay

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GraphQL Variables are not being parsed

Ethereal82 opened this issue · comments

Currently our work around is to remove the filter for variables and change from asString to toString in GraphQLController (lines 30-35).

Here is the snippet:

val body = json.asObject
      .getOrElse(throw new IllegalStateException(s"Invalid json [$json].")).toMap
    val query = body("query").as[String].getOrElse("{}")
    val variables = body.get("variables")
      .map(x => graphQLService.parseVariables(x.toString))
    val operation = body.get("operationName").flatMap(_.asString)

Is there a reason for filtering out variables from the body and using asString when setting the variables variable?

Thanks!

Whoops, the filter was left behind from a debugging session. I almost never use variables, so I didn't notice the omission. Thanks for the report, I'll apply your (sensible) change tonight.