Fork me on GitHub
Fredrik Meyer14:03:44

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:

Fredrik Meyer14:03:09

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


Question about CORS.. should pedestal by default handle preflight OPTIONS requests, or do I need a route/interceptor for that?