[dagit] Avoid CORS in development
Make some changes to stop using CORS when developing Dagit.
- Define an origin instead of a full GraphQL path for our env var. We can use this as a proxy for webpack configuration, which will let us avoid CORS.
- Use the origin to build up the WebSocket URI.
- Just use the GraphQL path in the HttpLink configuration, which lets us use the webpack proxy.
In general CORS isn't an immediate problem during development, but it's something we don't need at all if we can avoid it,and it causes problems if the backend has issues with preflight requests.
Run yarn build-for-python, load Dagit with this prod build. Verify that Dagit loads and requests are performed correctly. (Not using proxy.)
Run dev Dagit with the origin env var. Verify same as above, and verify that POST requests are not preceded by preflight requests. (Using proxy.)
Reviewers: bengotow, dgibson, max, prha
Reviewed By: max
Differential Revision: https://dagster.phacility.com/D8805