I have a graphQL api that can be queried correctly via graphiQL with POST, but returns this when making the request in chrome:
XMLHttpRequest cannot load http://localhost:8000/dev/api. Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access.
My endpoint in serverless.yml is
functions: gateway: handler: handler.gateway timeout: 60 events: - http: path: api method: post cors: true
From the configs I’ve found in discussions in the repo, this seems to work for others when it comes to cors, but I get this issue both with
sls webpack serve locally and on my live endpoint. Thanks in advance.