This a hello world project to run a graphql server with nodejs and connect to it with Angular. The code comes in two parts: Server and client. We use graphql-yoga to run a nodejs server which supports graphql requests. For the client side we create an Angular project and use apollo-client to connect to the server.
In the following we explain:
- The example problem to solve
- Server side code
- Clien side code
For the simplest example that we can cover our content with I assumed a list of events which have a name, a location, and number of attendant. We like to see a list of all events with their live number attendants. Number of attendants should update automatically without refreshing the page.