Created
August 3, 2017 06:42
-
-
Save anonymous/b850a6ddddd0eba790ea46db1b2b0101 to your computer and use it in GitHub Desktop.
the description for this gist
This file contains 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
private def executeGraphQLQuery(query: Document, op: Option[String], vars: JsObject)(implicit e: ExecutionContext) = { | |
Executor.execute( | |
SchemaDef.ShopSchema, | |
query, | |
repository, | |
variables = vars, | |
operationName = op | |
).map(OK -> _) | |
.recover { | |
case error: QueryAnalysisError => BadRequest -> error.resolveError | |
case error: ErrorWithResolver => InternalServerError -> error.resolveError | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment