When you need to write code to access data, it is hard to beat the flexibility of SQL. SQL allows you to ask for exactly the data you need, for example to combine data from multiple tables and target precisely the lines and columns that are useful to you, in one single SELECT statement. However, when you need to integrate back-end applications with front-end applications, a REST API is the natural choice. REST has become the de facto standard for web and mobile applications, largely because of its interoperability and robustness.
What do you choose when you need to integrate back-end data with front-end applications? REST APIs tend to be rigid and static: exactly the opposite of SQL’s flexibility. Until recently, developers just made do with REST, but with GraphQL, you no longer have to.