In this tutorial, you’ll learn how to build a CRUD app with FastAPI, GraphQL, and Orator ORM.
By the end of this tutorial, you will be able to:
(And why GraphQL over traditional REST?)
REST is the de-facto standard for building web APIs. With REST, you have multiple endpoints for each CRUD operation: GET, POST, PUT, DELETE. Data is gathered by accessing a number of endpoints.
For example, if you wanted to get a particular user’s profile info along with their posts and relevant comments, you would need to call four different endpoints:
/users/<id>
returns the initial user data/users/<id>/posts
returns all posts for a given user/users/<post_id>/comments
returns a list of comments per post/users/<id>/comments
returns a list of comments per user#fastapi #graphql #api