How would I add some "auth required" to lacinia pedestal subscriptions?
its pretty easy with routing, since I can just inject something
but I am reloading the compiled schema on every request in dev
(defn routes [{:keys [config] :as system}]
(route/expand-routes
(set/union
#{["/api/v1/signup" :post `auth/sign-up :route-name ::sign-up-route]
["/api/v1/login" :post `auth/log-in :route-name ::log-in-route]
["/api/v1/logout" :post `auth/log-out :route-name ::log-out-route]
["/api/v1/photos/:name" :get [`auth/requires-auth-interceptor `photo-route] :route-name ::photo-route]
["/api/v1/graphql" :post
(-> (lp/default-interceptors (graphql/compiled-schema) nil)
::http/routes (if (config/production? config)
(routes system)
(fn [] (routes system)))
but it seems like to add subscriptions i need to wrap the whole service map
with (lp/enable-subscriptions)
which won't reload, and would have a different compiled schema instance
I can accept needing to reload the server to see changes in subscriptions
but will having a different compiled schema break stuff (horribly)?