IMO there is no best kind of API ... they both solve problems in their own ways. What you choose depends on what you are trying to achieve in what circumstance. The video covers everything up nicely. Good job dude!!
I love both GraphQL and REST API's on the back-end. The tricky part to me is on the front-end. Apollo Client with React is complex setting up the Cache. I heard that it's easier with React-Query. Whereas I can do simple API calls: POST, GET, UPDATE, and DELETE.
bro I just love these explainer videos. You have got a unique niche of explaining everyday developer stuff with a whiteboard and in a simple manner. Keep them coming.
If you use nestjs then it can autogenerate the schema for you based on code by providing some decorators for your code. Alternatively if you have a schema already you can generate types for your backend from schema file. Additionally you can generate boilerplate for grapgql object with the nest cli. Im new to graphql but enjoying it with nestjs. I think nestjs, typeorm and graphql is really powerful combo ❤️
One of the best explanations on RUclips! I still wonder one thing though... The GQL server returns a single response with exactly the data you need which makes it fast. However, wouldn't the GQL server still fetch the same amount of data from the DB? For example if you need a couple of fields from large userData collection that's tied to another large user collection, wouldn't GQL query the entirety of both of those collections from the DB? I get that not sending those over HTTP is a benefit but is it that much faster or am I missing something? On top of that, you have the data resolution that you have to do in the GQL server before sending it to the client which adds another layer of processing.
> However, wouldn't the GQL server still fetch the same amount of data You got it right. When you have gql type, let's say User { id: ID, fistName: String, lastName: String, dep: Department }, you should fetch all of them from the DB. However some libraries have a workaround - complex type support. This means you can make an additional resolver for department field. So that you can get the department from db only when this field (dep) was queried on the client.
This was a great video on each individual approach, but unfortunately did not live up to the title in actually comparing the two approaches in terms of use-case apart from detailing that a GraphQL req has the ability to control the fields returned. Still though, I really enjoy these videos! Keep it up!
REST would be faster because GraphQL sits behind a REST endpoint and has to perform all the validation and message parsing, whereas technically in REST you can even receive the request data as a stream
Let me give you a honest advise, your content is good, topics are good and thumbnails are great, but the moment we see a whiteboard, the video becomes uninteresting. This is the reason why your views are low. I am sorry but it is true. ❤
Learn Full Stack Development: cdm.sh/fullstack
This guy is the best! I came for WebSockets vs HTTP, and just went down a rabbithole.
IMO there is no best kind of API ... they both solve problems in their own ways. What you choose depends on what you are trying to achieve in what circumstance. The video covers everything up nicely. Good job dude!!
I love both GraphQL and REST API's on the back-end. The tricky part to me is on the front-end. Apollo Client with React is complex setting up the Cache. I heard that it's easier with React-Query. Whereas I can do simple API calls: POST, GET, UPDATE, and DELETE.
bro I just love these explainer videos. You have got a unique niche of explaining everyday developer stuff with a whiteboard and in a simple manner. Keep them coming.
The best explanation I've ever seen on GraphQL and REST API. Keep these videos coming.
No bullshit, this guy is the best. If you want coding explained well, get an indian. Also applies to pretty much any subject.
6:51 The reason I love GraphQL. Thanks, Mehul bhaiya for the explanation.
If you use nestjs then it can autogenerate the schema for you based on code by providing some decorators for your code. Alternatively if you have a schema already you can generate types for your backend from schema file. Additionally you can generate boilerplate for grapgql object with the nest cli. Im new to graphql but enjoying it with nestjs. I think nestjs, typeorm and graphql is really powerful combo ❤️
Even if know topics, I always learn new things from your videos. Thankyou keep posting.
The explanation is great but kindly manage that ring light.
Now that you mention it, I can't focus at all.
Love these random topics you keep making videos on. I keep learning different things. Thanks to youtube's algo too.
I am really liking the kind of topics you are choosing.
This one is really amazing now I will definitely try graphQL. Thanks for the wonderful explanation bro 😎🔥🔥🎉🎉
Very Informative
Great video! 🔥
One of the best explanations on RUclips!
I still wonder one thing though... The GQL server returns a single response with exactly the data you need which makes it fast. However, wouldn't the GQL server still fetch the same amount of data from the DB? For example if you need a couple of fields from large userData collection that's tied to another large user collection, wouldn't GQL query the entirety of both of those collections from the DB? I get that not sending those over HTTP is a benefit but is it that much faster or am I missing something? On top of that, you have the data resolution that you have to do in the GQL server before sending it to the client which adds another layer of processing.
> However, wouldn't the GQL server still fetch the same amount of data
You got it right. When you have gql type, let's say User { id: ID, fistName: String, lastName: String, dep: Department }, you should fetch all of them from the DB.
However some libraries have a workaround - complex type support. This means you can make an additional resolver for department field. So that you can get the department from db only when this field (dep) was queried on the client.
Amazing Video ❤️
Hey Bro
Good and Informative Content
Just Remove Background Music
Nice explanation!
great job, bro, keep on
This was a great video on each individual approach, but unfortunately did not live up to the title in actually comparing the two approaches in terms of use-case apart from detailing that a GraphQL req has the ability to control the fields returned. Still though, I really enjoy these videos! Keep it up!
Graphql for connected data,REST for the rest.
addicted to your video's
I like your attitude, subbed
Thank you
Nice! thanks.
Mehul can you please make a video on how you learn things or even a twitter thread works
In REST also, we can have select params in query parameter as a comma-separated string, right?
in graphQL it pretty easy and graphQL creates api documentation automatically
@@majidshah48 rest also creats
GraphQL is way to go for me though 🔥🔥
Videos are lit BtW
Great video 🔥 helped me alot
Great Content 👍🏻
Great explain
What about in terms of performance? Which one is better?
REST would be faster because GraphQL sits behind a REST endpoint and has to perform all the validation and message parsing, whereas technically in REST you can even receive the request data as a stream
Keep these coming!
You deserve a subscribe and like.
Great wideo
Great explanation :-)
Thanks for such awesome videos, always waiting for your new videos, will be glad to get t-shirt giveaway
quality content.
When you gonna release Graphql whole series on codedamn?
ty
It's always good staff here let's code the jounery
Which outro music
amazing🔥💀
COMMENTED FOR T SHIRT GIVEAWAY!! :)
I love REST more
If you can please record in hindi also.
Pls sir adjust lighting it is so distracting 🥺🙏
White HALO in the center in every recent video..
To be honest, I am here for the GIVEAWAY 🤦♂️
🧐🧐🧐
None!!
May the like be on this comment.
Let me give you a honest advise, your content is good, topics are good and thumbnails are great, but the moment we see a whiteboard, the video becomes uninteresting. This is the reason why your views are low. I am sorry but it is true. ❤
Great content 🔥