adding more validation.
This commit is contained in:
@@ -16,9 +16,14 @@
|
||||
(when (= "none" (:role (:identity r)))
|
||||
(throw-unauthorized))
|
||||
|
||||
(let [variables (some-> (query-params "variables")
|
||||
edn/read-string)]
|
||||
{:status 200
|
||||
:body (pr-str (ql/query (:identity r) (query-params "query") variables ))
|
||||
:headers {"Content-Type" "application/edn"}})))
|
||||
(try
|
||||
(let [variables (some-> (query-params "variables")
|
||||
edn/read-string)]
|
||||
{:status 200
|
||||
:body (pr-str (ql/query (:identity r) (query-params "query") variables ))
|
||||
:headers {"Content-Type" "application/edn"}})
|
||||
(catch Exception e
|
||||
{:status 400
|
||||
:body (pr-str {:data (merge {:message (.getMessage e)} (ex-data e))})
|
||||
:headers {"Content-Type" "application/edn"}}))))
|
||||
wrap-secure))
|
||||
|
||||
Reference in New Issue
Block a user