This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-03-10
Channels
- # announcements (1)
- # babashka (44)
- # beginners (188)
- # calva (37)
- # chlorine-clover (28)
- # cider (12)
- # clj-kondo (40)
- # clojars (1)
- # clojure (323)
- # clojure-austin (7)
- # clojure-europe (20)
- # clojure-italy (4)
- # clojure-nl (16)
- # clojure-spec (7)
- # clojure-uk (37)
- # clojuredesign-podcast (1)
- # clojurescript (30)
- # cryogen (2)
- # cursive (30)
- # data-science (1)
- # datomic (26)
- # emacs (1)
- # events (1)
- # figwheel-main (13)
- # fulcro (89)
- # garden (1)
- # graalvm (20)
- # graphql (8)
- # jobs (1)
- # jobs-discuss (1)
- # joker (6)
- # kaocha (125)
- # lambdaisland (1)
- # meander (42)
- # off-topic (18)
- # pathom (3)
- # pedestal (6)
- # shadow-cljs (55)
- # spacemacs (21)
- # sql (18)
- # tools-deps (8)
- # uncomplicate (2)
- # vim (1)
- # yada (3)
Short question: I try to use pedestal+Lacinia to build a GraphQL endpoint. It works perfectly fine in the GraphiQL endpoint. but it fails when I try to use the endpoint in Apollo+Javascript. I get a 404 on the preflight request - and I don't know how to handle this. Any tips?
I’m not sure. Perhaps @U04VDKC4G knows?
The URL for the websockets connection is different that the URL for normal GET/POST, which is just unavoidable due to how the Jetty stack operates. See this: https://lacinia-pedestal.readthedocs.io/en/latest/subscriptions.html#endpoint
maybe make sure your config allows all origins, here's an example: https://github.com/pedestal/pedestal/blob/master/samples/template-server/src/template_server/server.clj#L34
Thanks @danvingo! Adding the line ::http/allowed-origins {:creds true :allowed-origins (constantly true)}
worked. Appears I need to learn more about cors and origins and such, because I don't understand why this worked