Created
November 20, 2019 19:10
-
-
Save duanebester/b6a6dbd977e46a2b44eecd889c3dd55e to your computer and use it in GitHub Desktop.
Endpoint with vars
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
QueryParser.parse(query) match { | |
case Success(queryAst) => | |
val variables = fields.get("variables") match { | |
case Some(obj: JsObject) => obj | |
case _ => JsObject.empty | |
} | |
complete(executeGraphQLQuery(queryAst, None, variables)) | |
case Failure(error) => | |
complete(BadRequest, JsObject("error" -> JsString(error.getMessage))) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment