This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-04-15
Channels
- # announcements (10)
- # beginners (113)
- # calva (2)
- # cider (75)
- # clj-kondo (1)
- # cljdoc (2)
- # clojure (142)
- # clojure-europe (11)
- # clojure-gamedev (6)
- # clojure-italy (7)
- # clojure-nl (8)
- # clojure-spec (3)
- # clojure-uk (50)
- # clojurescript (47)
- # cursive (7)
- # data-science (22)
- # datomic (12)
- # dirac (3)
- # events (1)
- # fulcro (114)
- # gorilla (1)
- # jackdaw (5)
- # joker (3)
- # kaocha (10)
- # leiningen (1)
- # liberator (2)
- # mount (6)
- # nrepl (1)
- # off-topic (16)
- # pathom (34)
- # pedestal (3)
- # re-frame (19)
- # reagent (11)
- # remote-jobs (5)
- # shadow-cljs (127)
- # spacemacs (12)
- # test-check (15)
- # tools-deps (8)
- # vim (4)
I’m doing this by calling graphql-routes
instead of service-map
, adding it to my other routes, and building my own pedestal service
You could call service-map
with a :routes
arg that you build with graphql-routes
yourself
@emccue mine looks like this:
(def extra-routes
#{["/tasks/update-articles" :get update-articles :route-name :tasks/update-articles]})
(mount/defstate service
:start
(let [{profile :profile} (mount/args)]
(-> schema/footballpedia-schema
(lp/service-map {:graphiql (not= :prod profile)})
(update ::http/routes set/union extra-routes)
(assoc ::http/allowed-origins (if (= :prod profile)
allowed-origins
(constantly true)))
(assoc ::http/host "0.0.0.0")
(assoc ::http/port 8080)
http/create-server
http/start))
:stop (http/stop service))