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))