Skip to content

Commit

Permalink
better integration and fix graphql proxy to REST plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
Zwiterrion committed May 24, 2024
1 parent 21428f9 commit 7cb5416
Show file tree
Hide file tree
Showing 6 changed files with 291 additions and 222 deletions.
7 changes: 5 additions & 2 deletions otoroshi/app/next/plugins/graphql.scala
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ object GraphQLQueryConfig {
"query" -> o.query,
"timeout" -> o.timeout,
"response_path" -> o.responsePath.map(JsString.apply).getOrElse(JsNull).asValue,
"response_filter" -> o.responsePath.map(JsString.apply).getOrElse(JsNull).asValue
"response_filter" -> o.responseFilter.map(JsString.apply).getOrElse(JsNull).asValue
)
}
}
Expand Down Expand Up @@ -1164,7 +1164,10 @@ class GraphQLBackend extends NgBackendCall {
builder = customBuilder,
initialData = config.initialData.map(_.as[JsObject]).getOrElse(JsObject.empty),
maxDepth = config.maxDepth,
variables = (jsonBody \ "variables").asOpt[JsValue].getOrElse(Json.obj()).as[JsObject]
variables = (jsonBody \ "variables").asOpt[JsValue]
.getOrElse(Json.obj())
.asOpt[JsObject]
.getOrElse(Json.obj())
)
case None => jsonResponse(400, Json.obj("error" -> "query field missing")).future
}
Expand Down

0 comments on commit 7cb5416

Please sign in to comment.