started adding graphql

This commit is contained in:
Bryce Covert
2018-04-10 18:36:20 -07:00
parent 53905c317b
commit 4165c7d180
9 changed files with 136 additions and 7 deletions

View File

@@ -0,0 +1,17 @@
(ns auto-ap.routes.graphql
(:require [auto-ap.db.companies :as companies]
[auto-ap.routes.utils :refer [wrap-secure wrap-spec]]
[auto-ap.entities.companies :as entity]
[auto-ap.graphql :as ql]
[compojure.core :refer [GET PUT context defroutes
wrap-routes]]))
(defroutes routes
(wrap-routes
(context "/graphql" []
(GET "/" {:keys [query-params]}
{:status 200
:body (pr-str (ql/query (query-params "query")))
:headers {"Content-Type" "application/edn"}}))
wrap-secure))