Access to fetch at 'https://mydomain.io/dev/functions/graphql' from origin 'https://www.mydomain.io' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
So, I need to add to the graphql Function response headers:
`'Access-Control-Allow-Origin': '*' 'Access-Control-Allow-Credentials': true`
But I didn’t found a way of adding the headers.
I found here that is posible to pass options to the
createHandler method in
The questions to solve are:
- Is there a way to pass these options in
- Is there another strategy to handle cors on graphql.js?