Hello everyone,
I have set up an API mesh using the API Mesh Basics documentation (https://developer.adobe.com/graphql-mesh-gateway/mesh/). After that, I tried to execute a query from my local React application to retrieve the data, but it failed due to a CORS error. So, I added the following options to my mesh.json file:
{
...
"responseConfig": {
"CORS": {
"origin": "*",
"methods": [
"GET",
"POST",
"OPTIONS",
],
"maxAge": 60480,
"credentials": true,
"exposedHeaders": [
"Content-Range",
"X-Content-Range"
]
}
}
...
}
However, I am still getting a CORS error, and I can't figure out the issue.
When I send a GET request to the GraphQL endpoint with parameters in the URL, it works. But a POST request doesn't work.
Does anyone have any ideas on how I can fix this?
React-APP Error:
When i use the web interface (Yoga GraphQL Web Interface) after running the command "aio api-mesh run mesh.json" everything works fine.
Thanks