We will build a basic blog application. Our application will have multiple Users and they will be associated with multiple Posts.
For the sake of simplicity, we will not include authentication. We managed to authenticate users with devise-token_authenticatable by following this tutorial. You can check our project repository and see how we implemented it.
$ rails new <app_name> --api -T -d…
“GraphQL, despite the name, isn’t simply a query language. It’s a comprehensive solution to the problem of connecting modern apps to services in the cloud. As such, it forms the basis for a new and important layer in the modern application development stack: the data graph. This new layer brings all of a company’s app data and services together in one place, with one consistent, secure, and easy-to-use interface, so that anyone can draw upon it with minimal friction.” — Principled GraphQL
The API-Rest architecture suggests that we should retrieve its data according to the routes we are requesting. Let’s say that you want to get the data for a user in our system with
id=1. If we were to ask the API for this data, we would need to make a GET request to
/users/1 to retrieve this user’s data. …