Our Apollo client doesn’t want to accept CORS coming from the SpringBoot graphQL server in our TEST environment. It doesn’t have a problem with it when running the ReactJS app and SpringBoot locally. I’ve tried configuring the HttpLink in several different ways without success. This is what I currently have configured and it doesn’t like that either. Any suggestions would be greatly appreciated.
As you are using headers that are not on the CORS safelist, you will not be able to use mode: 'no-cors'.
If your server is on another domain, you will likely have to use mode: 'cors'.
After that, there is nothing to do on the Apollo Client side.
CORS is configured on the server - it’s a security mechanism between the user’s browser and the server. No JavaScript on the client has any influence on that.
=> You will have to configure your server correctly, there is nothing you can do about this on the client.
That also means that you can (and should) stop sending this Access-Control-Allow-Origin to your server. That’s a header the server has to send to the browser, not the other way round.