very basics of security have been added.

This commit is contained in:
Bryce Covert
2018-06-04 22:22:15 -07:00
parent 44fff9e88a
commit fbccc0b209
6 changed files with 27 additions and 23 deletions

View File

@@ -9,7 +9,7 @@
(defroutes routes
(wrap-routes
(context "/companies" []
(GET "/" []
(GET "/" r
{:status 200
:body (pr-str (companies/get-all))
:headers {"Content-Type" "application/edn"}})

View File

@@ -11,11 +11,11 @@
(defroutes routes
(wrap-routes
(context "/graphql" []
(GET "/" {:keys [query-params]}
(GET "/" {:keys [query-params] :as r}
(let [variables (some-> (query-params "variables")
edn/read-string)]
(println variables)
{:status 200
:body (pr-str (ql/query (query-params "query") variables))
:body (pr-str (ql/query (:identity r) (query-params "query") variables ))
:headers {"Content-Type" "application/edn"}})))
wrap-secure))