Call ECS GraphQL Endpoint without CORS


I’m looking to deploy a GraphQL service through ECS, I’m curious as to the patterns recommended in order to call this service from a serverless based NextJS application.

The problem I’m trying to come up with a solution for is how to manage a path to GraphQL from the application itself without exposing the service over CORS. Ideally, the /graphql endpoint would exist on the same domain as my serverless nextjs application and be routed properly to the ECS based backend.

Any tips on how to accomplish this would be much appreciated, thanks!