Reputation: 194
I'm setting up GraphQL subscription as per this tutorial: https://hasura.io/docs/1.0/graphql/core/guides/integrations/apollo-subscriptions.html
I'm getting CORS error and all my requests to web sockets are failed. How can I resolve it?
Upvotes: 1
Views: 1177
Reputation: 550
Hasura uses a special way for dealing with CORS, depending on which environment you are using. If you are using heroku, in your env variables you need to add Hasura specific variables to enable CORS.
HASURA_GRAPHQL_CORS_DOMAIN="https://*.foo.bar.com:8080, http://*.localhost, http://localhost:3000, http://example.com"
Check out the CORS configuration example
Upvotes: 3