pedestal

donaldball 2019-04-15T01:20:44.007600Z

I’m doing this by calling graphql-routes instead of service-map, adding it to my other routes, and building my own pedestal service

donaldball 2019-04-15T01:22:05.008200Z

You could call service-map with a :routes arg that you build with graphql-routes yourself

sooheon 2019-04-15T10:11:01.009700Z

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