FastAPI and GraphQL - build your first API

preview_player
Показать описание
API Development with FastAPI, GraphQL, SQLAlchemy, Alembic, PostgreSQL, Uvicorn and Docker. In this tutorial we take a first look at building an API with FastAPI and GraphQL. We build an API that will allow posting, mutations and queries. SQLAlchemy + Alembic is used to manage migrations, PostgreSQL + PGAdmin all wrapped deployed in Docker/Docker-Compose.

00:00 Introduction
02:02 Preview of final API implementation

Part 1 (Optional)
03:04 Docker PostgreSQL and PGAdmin docker configuration / setup
Part 2
20:12 Model development and migration
Part 3
44:48 Building an API with GraphQL and FastAPI

Code Repository 002: FastAPI with GraphQL

001: FastAPI with REST

🐱‍🏍Would you like to SUPPORT US FURTHER so that we can make even more great content - Please consider joining our members community.

👍SUBSCRIBE to get more free tutorials, courses and code snippets!
Рекомендации по теме
Комментарии
Автор

Amazing tutorial.
If you're coming here in 2023, here's a couple of things you need to know.
1. graphql is no longer accessible through starlette, use from starlette_graphene3 import GraphQLApp
2. app.add_route is nolonger valid, use app.mount
3. to get the GUI, you'll need make_graphiql_handler() from starlette_graphene3.

Your imports should be:
from starlette_graphene3 import GraphQLApp, make_graphiql_handler

your route method should be:
app.mount("/graphql", GraphQLApp(schema=graphene.Schema(query=Query, mutation=PostMutations), on_get=make_graphiql_handler()))

dhruvpatel
Автор

I'm a Cuban Brazilian and found this tutorial incredible, you are the best!!!

cubano_sin_filtro_en_brasil
Автор

If you installed starlette > 0.17 .0 you should install starlette-graphene3, so to use "from starlette_graphene3 import GraphQL Api" instead "from starlette.graphql import GraphQLApp"

luisfranciscoyanezblanco
Автор

This is great. I like tutorials that explore how to build a real project showing how different technologies interact and integrate. Hope to see more.

mabagoury
Автор

Couldn't find another tutorial like this anywhere. Thanks for doing this!

tonyromano
Автор

The starlette-graphene3 is not being recognized by FastAPi() anymore. Been looking at some docs but it seems it was deprecated? Specifically on the GraphQLApp part. Any suggestions or updates?

jdpenuliar
Автор

There has been some form of a refactor of the Graphene Code, I will be very happy if you do another video based on the current specifications.

pipi_delina
Автор

Wow, asked you last time. thanks for this again.

davishek
Автор

Your videos are freaking amazing, im surprised u only have 17k followers.

gtv
Автор

Awessome Video as always. Thanks man 😊.

justacasualdeveloper
Автор

An awesome video as always. Hope best man 😉

abdoramandawud
Автор

Is there a similar Video with MongoDB?

Haggyk
Автор

starlette.graphql has been deprecated. What can I use in place of it such that all other dependencies remain just the same ?

shalineesharma
Автор

I am asking again if you can give us a new update on this... cant seem to figure out why graphene and starlette are not resolving although they are installed

pipi_delina
Автор

Great tutorial, but i'm getting this error "cannot import name 'connection_from_list_slice' from, do you have any idea about why this is happening or how i could solve it?

elysium-hf
Автор

Hello. I have used your approach and made minor changes to be able to use it from the react front end. For Fast API i have added CORS middleware and calling them using fetch fucntions in react. However, since i have added this middle ware to the Fastapi, i am getting the following error: "SLL SYCALL Error: EOF detected". This would happen, when i keep the session idle for few mins. I will have to always restart the docker to be able to resume the operations back. do you happen to know what would be causing this error?

munivinayk
Автор

It's super awesome, keep going!
May you please also show an example with relations in DB and how to manage them in graphql?

anthonyvetrenko
Автор

Your videos are just like Diamonds to
Btw, I have a question.
May I know your opinion about Django vs FastAPI?

abrarshahid
Автор

Real helpful thank you. What version of Python are you using?

ericsalesdeandrade
Автор

Why is it true that when I log in to PGadmin, I am prompted to check my password when I am told that my password is compromised

kunyan