Creating React client-side Hooks for querying Apollo GraphQL
In order to tie the two parts of our app together, we need to add CORS to our Express server. CORS stands for Cross-Origin Resource Sharing. It means that our server will be set up to allow a client domain that is not the same as its own domain.
In most server configurations of even modest complexity, the server that hosts the client-side application and the server that provides the API do not exist on the same domain. In general, you will have a proxy of some kind, for example, NGINX, that will accept calls coming from the browser. And that proxy will "redirect" calls as required. We will explain how reverse proxies work in more detail in Chapter 17, Deploying an Application to AWS.