Closed nareshbhatia closed 2 years ago
I am not familiar with GraphQL, but any reason why GraphQL is not exposed as /graphql
endpoint that the Front-End use with NGNIX routing it? With proper authentication it should not be a problem
This is a good idea. Let me explore further.
Thanks @themegaphoenix, I was able to do this successfully. Note that there was an additional complication - the relative URL works only client-side, server side must use the docker network URL. I have handled this when initializing the Apollo Client. See here.
In docker-compose.yaml, we specify the
NX_API_URL
environment variable as follows:This works for the server side, but client side is not able to access
http://proshop-api:8080
. Theproshop-api
domain is not known to the client.We were able to work around this issue when deploying individual docker containers by specifying actual IP address of the machine. For example:
But this is a pure hack!!