From the official website -> GraphQL is a query language for APIs and a runtime for fulfilling those queries with your existing data. GraphQL provides a complete and understandable description of the data in your API, gives clients the power to ask for exactly what they need and nothing more, makes it easier to evolve APIs over time, and enables powerful developer tools.
Simply put, graphQL is a query language, like SQL, which helps query the data stored in our graph. I won't go into the details about what a graph is but basically it is a data structure, if you need more details about graph there are several books and youtube videos on graphs and graph theory.
We will be working with Node.js and express-graphql and Typescript in this tutorial.
- let's install the dependencies first
npm install express express-graphql graphql
- Let's install the types
npm install -D @types/graphql @types/express @types/node
express-graphql and pass it as a middleware to our express app. The
graphiql: true option enables the interactive playground for our graphql server. Now if you run the server there will be an error let's fix that.
Thanks for reading :)