Origin Forbidden (GraphQL API Request)

I know that GraphQL API will be deprecated in March of 2025 (correct me if I’m wrong) but I still wanted to point out the solution to an error that had me frazzled for a couple days so I can potentially save some headaches for you.

When I made a request to the GraphQL API from my React app hosted on localhost:3000 I kept getting an error in the Network Tab of my browser as well as the Logs in Atlas App Services that the origin was forbidden.

I don’t know what IDE other folks use but I use VS Code which is pretty much standard as far as I know. When you compile your code in the builtin terminal it will list the following message:

Compiled Successfully!

Local:               http://localhost:3000

On Your Network:     http://555.555.555.5:3000 (example only)


So the solution is to go into Atlas App Services under App Settings and add the “On Your Network” address found in the terminal. This removed the Origin Forbidden error and allowed me to make the request.

Also see:

Update:

I’m getting the error again. It was working for a while and then stopped. Any input is appreciated.

Okay the error magically disappeared the next day. I don’t know what’s going on but at least it’s fixed for the time being.