GraphQL Crash Course

  Рет қаралды 30,190

Hussein Nasser

Hussein Nasser

4 жыл бұрын

💻 More software engineering videos • Software Engineering b...
GraphQL Pros and Cons, examples and when to use over REST
GraphQL is an open source query language developed by facebook that allows clients to formulate queries to get different results. Its main goal is to combine multiple services into one endpoint. In this video we will discuss what is GraphQL, why facebook developed it, go through some examples using github GraphQL API, finally we will discuss the pros and cons and when you should use this technology.
- What is GraphQL?
- Examples
- Pros and Cons
- when to use REST vs GRAPHQL
What is GraphQL
- Schema
- Query language
- Nesting
- Mutation and subscription
Examples
Schema intro
Github API
Rest api
Pros
- Flexibility
- efficient response : payload back only get what you want of fields since you know the schema
- No round trips- Avoiding multiple round trips (HATEOS REST)
- Uniform single interface API endpoint
- Self documenting
Cons
- Complexity
- Typed system - ( use it to know if a type is available or not and fork logic) slows down adoption.. same as soap
- No Caching etag since always POST
- Error management non-standard for HTTP.
- Over engineering can lead to Inefficiency of the joins can lead to performance and DOS
developer.github.com/v4/guide...
WHEN TO USE GRAPHQL
Public ad-hoc API that you can’t predict how it will be used
Specific and well-design use cases API
Simple API that serves one client (webpage)
Enterprise API (new york times)
Well defined schema
Without the need of performing multiple round trips. It as a reaction to certain limitations of the REST API.
Schema
all post
except schema call get
via fetch api
Source Code for RESTAPI vs GraphQL
github.com/hnasr/javascript_p...
Jump Codes
2:30 What is GraphQL?
13:50 Properties of GraphQL
18:00 Examples
34:00 Pros and Cons
47:10 When to use GraphQL over REST
Cards
4:00 REST API
31:20 GIT HUB REST API
33:00 Caddy Web Server
43:55 GET VS POST
Support me on PayPal bit.ly/33ENps4
Become A Patron / hnasr
Stay Awesome!
Hussein

Пікірлер: 54
@hnasr
@hnasr 4 жыл бұрын
Time Codes 2:30 What is GraphQL? 13:50 Properties of GraphQL 18:00 Examples 34:00 Pros and Cons 47:10 When to use GraphQL over REST
@mrcrazyenough007
@mrcrazyenough007 4 жыл бұрын
The guy really enjoys teaching! Such a cool one.
@suhasc9418
@suhasc9418 4 жыл бұрын
The way you explain, makes all the difference. Thanks for all the wonderful tutorials and for many more to come. God Bless you! :)
@hnasr
@hnasr 4 жыл бұрын
Suhas C thanks Suhas! Glad you found the videos useful, stay awesome!
@stevoschannel
@stevoschannel Жыл бұрын
Honestly, I love your videos, Thanks Hussein! No other videos actually make me smile while I listen
@BHFJohnny
@BHFJohnny 4 жыл бұрын
Ok, after endless procrastination, I finally got to this :D Thank you!!!
@mishrasidhant
@mishrasidhant 3 жыл бұрын
Loving your style of explaining! 🙏🏾
@qsami5865
@qsami5865 2 жыл бұрын
استاذ حسين كل الحب زادك الله علما ونفعا به
@mateoguevara923
@mateoguevara923 4 жыл бұрын
Hey man, amazing video, I'm actually developing an app for shopify, and since their apis use graphql, I had to learn it, best tutorial by far, simple and clear, keep doing ya thing!
@hnasr
@hnasr 4 жыл бұрын
Thank you Mateo! All the best. On your app 🙏
@the_maroon_knight
@the_maroon_knight 2 жыл бұрын
A great starting point to learn GraphQL to learn it in depth.
@kamarajkannan4072
@kamarajkannan4072 4 жыл бұрын
Hi Hussien Nasser sir, your channel is something special to me. Mostly I do blind code but now I watch your videos to understand basics. Now I able to connect with what I doing . I am interested in-sourcing with graphQL.
@hnasr
@hnasr 4 жыл бұрын
Thank you Kamaraj!! Happy you find content useful
@khatritariq
@khatritariq 4 жыл бұрын
You explain things very well. Thank you for your efforts.
@hnasr
@hnasr 4 жыл бұрын
Thanks Tariq appreciate it! Have a great weekend and enjoy the content
@yadusolparterre
@yadusolparterre 3 жыл бұрын
Thank you so much, Hussein. I am learning so much thanks to you.
@falanges5301
@falanges5301 9 ай бұрын
I love you so much Hussein thank you for being alive!
@smoothbeak
@smoothbeak 3 жыл бұрын
Really good eplanation at the start about what makes GraphQL different from REST and a good option
@fuckcorporati0ns
@fuckcorporati0ns Жыл бұрын
Thank you so much Hussein, I love your videos and your explanation. Wish you stay healthy and enthusiastic to share more knowledges with us
@marwanatef3652
@marwanatef3652 Жыл бұрын
Getting to the point with a very clear yet short explanation is one of the things one admire about this channel, thank you! One thing that would have made this video greater if you used a GraphQl Client like Altair (A Chrome extension) that loads the schema and offers a complete playground for working with graphql apis, kindly check it out.
@thirislifelogs
@thirislifelogs 8 ай бұрын
awesome tutorial. thank you!
@elijahlair
@elijahlair Жыл бұрын
Well understood. Both REST and GraphQL are great technologies, depending on what your client request types are. Thank you
@animatedzombie64
@animatedzombie64 3 жыл бұрын
hussein: don't get attached to anything, Me, already attached to this channel, watching backend things
@mtvspec
@mtvspec 9 ай бұрын
Expensive queries con can be solved by persisted queries - client sends query id and server associates it with corresponding query. This way client sends only persisted query id and query variables (if any). Awesome explanation of GraphQL, thank you very much ❤
@alekseiborsenkodev
@alekseiborsenkodev 3 жыл бұрын
Very cool video. But I would like to add that GQL not only brings everything to 1 endpoint (well, not actually but close). It also acts as abstraction layer that IMHO is easier to understand then REST
@ibrahim47
@ibrahim47 4 жыл бұрын
With great power comes great responsibility, this is the first thing that comes into my mind when graphql is mentioned. The problem with graphql is that it needs a learning curve itself and the problems it comes with are different, for example the N+1 problem, and to solve it you most probably will use solutions (like dataloaders) that may bring even new problems, also the graphql specification didn't cover alot of implications like security.
@hnasr
@hnasr 4 жыл бұрын
Ibrahim Mohammed well said! I think Your talking more from the backend implementation of GraphQL and yes that has its own set of challenges And thanks for mentioning the N+1 problem as well.
@ibrahim47
@ibrahim47 4 жыл бұрын
@@hnasr urw Hussein and thanks for this great video, looking forward for more videos
@grillbaer
@grillbaer 3 жыл бұрын
Very coolisher video, thank you!
@gracielarosascalvo6762
@gracielarosascalvo6762 4 жыл бұрын
I love your courses
@gradientO
@gradientO 4 жыл бұрын
Thank you!!!
@chijiokesamuel5077
@chijiokesamuel5077 9 ай бұрын
Thank you so much.
@tambolaking5383
@tambolaking5383 4 жыл бұрын
One can limit number of requests per minute and number of requests per month for each client to stop any attacks.
@amu281
@amu281 Жыл бұрын
Please explain the term "Rest is Schema-Less". When I use the Rest we do have the Model(Bean), may join couple of tables but finally one model, which we represent to consumers. So I am consufed that even rest has schema associated with it. Any reference is also fine.
@nabhagmotivaras2884
@nabhagmotivaras2884 Жыл бұрын
MasterPiece!!
@shivaganga9148
@shivaganga9148 2 жыл бұрын
Hussein Sir could do please make a content on Restful API
@shivaganga9148
@shivaganga9148 2 жыл бұрын
got it you already did it
@willymcnamara1429
@willymcnamara1429 Жыл бұрын
im pretty new to webdev, and would appreciate clarity on this point- Hussein refers to REST as "schema-less" in comparison to GraphQL. why is that? when I've made RESTful API's, they've had server-side 'controller' functions which either format very specific db queries, or reformat the db response to fit what the client is requesting before sending back a response. isn't this a schema of sorts? is this not a best practice?
@0xc0ffee_
@0xc0ffee_ Жыл бұрын
The difference is that you can change the backend to whatever you want and the client won't know about it. You have to shake hands and communicate between frontend and backend and decide on a schema. With GraphQL there's no handshake or meetings needed to define schemas. You can simply query for whatever you want. And backend won't be able to break the frontend because you cannot change already existing schemas.
@abdelraoofrabie3024
@abdelraoofrabie3024 2 жыл бұрын
Great content, But the low tune makes a lot of misses for me.
@manmohanmundhraa3087
@manmohanmundhraa3087 Жыл бұрын
in a single REST call we can do everything what graphQL can do. if requirement is there ...
@mohammedsamir5142
@mohammedsamir5142 4 жыл бұрын
Awesome man! Allah bless you! 💙💜👍
@hnasr
@hnasr 4 жыл бұрын
Mohammed Samir Mohammed ❤️❤️❤️ شكرا عزيزي
@takshpatel8109
@takshpatel8109 2 жыл бұрын
👌👌👌👌
@alakdam3970
@alakdam3970 4 жыл бұрын
Hi Hussein Can you please make one tutorial, Where client(front end : React, server: express-graphql, apollo-server and database: postgresql) can upload photo to database. I know I am asking too much but it will help lots of young developers like me. Thanks for such a nice tutorials.
@gaunterodimm3569
@gaunterodimm3569 4 жыл бұрын
you may need to find a magic lamp mate!
@arnabmukherjee5840
@arnabmukherjee5840 3 жыл бұрын
Bro i am checking your videos for last few months, just a suggestion : Don't focus on content length , Make it as crisp as possible. Keep spreading knowledge. Awesome tutorials.
@SigmaSid98
@SigmaSid98 2 жыл бұрын
উনি যথেষ্ঠ engaging video create করেন। আপনাকে বেশি জ্ঞান দিতে হবে না ।
@Ty1er
@Ty1er 2 жыл бұрын
🙏🙏🙏❤️❤️❤️❤️❤️
@alwahsh
@alwahsh Жыл бұрын
هل برأيك متحدثو الإنجليزية بحاجة إلى من يشرح لهم تقنية شُرحت لديهم عشرات المرات؟ أم أنك غافل عن حال المصادر التعليمية العربية المتدهور؟ أم أنك آثرت التصدق على عدوك الغني على حساب أخيك الفقير؟
@khalilsandal8070
@khalilsandal8070 Жыл бұрын
the video is too long, you talk a lot with no infos, I even make the speed of the video 2x and still felt bored out of my mind, I will lookup other videos to learn GraphQL
@Ty1er
@Ty1er 2 жыл бұрын
🙏🙏🙏❤️❤️❤️❤️❤️❤️
Redis In-Memory Database Crash Course
50:01
Hussein Nasser
Рет қаралды 54 М.
Они убрались очень быстро!
00:40
Аришнев
Рет қаралды 3,1 МЛН
2000000❤️⚽️#shorts #thankyou
00:20
あしざるFC
Рет қаралды 15 МЛН
gRPC Crash Course - Modes, Examples, Pros & Cons and more
1:19:38
Hussein Nasser
Рет қаралды 221 М.
GraphQL vs REST: what you need to know
10:11
Kodaps Academy
Рет қаралды 14 М.
What Is GraphQL?
14:27
Syntax
Рет қаралды 450 М.
WebSockets Crash Course - Handshake, Use-cases, Pros & Cons and more
47:33
The Truth About GraphQL
12:06
Theo - t3․gg
Рет қаралды 93 М.
The Hidden Cost Of GraphQL And NodeJS
28:35
ThePrimeTime
Рет қаралды 182 М.
How Instagram content is served through GraphQL - Devtooling Instagram
27:28
tRPC, gRPC, GraphQL or REST: when to use what?
10:46
Software Developer Diaries
Рет қаралды 69 М.
GraphQL vs REST: Which is Better for APIs?
7:31
IBM Technology
Рет қаралды 183 М.
How charged your battery?
0:14
V.A. show / Магика
Рет қаралды 5 МЛН
AI от Apple - ОБЪЯСНЯЕМ
24:19
Droider
Рет қаралды 112 М.
Настоящий детектор , который нужен каждому!
0:16
Ender Пересказы
Рет қаралды 297 М.