Learn GraphQL In 40 Minutes

Поделиться
HTML-код
  • Опубликовано: 28 сен 2024
  • GraphQL is the hottest technology when it comes to server side APIs for good reason. It is incredibly fast to develop with, and it makes building a front-end painlessly easy. In this video I am going to be teaching you what GraphQL is, why it is important, why it is better than REST, and then we will be walking through an entire Node.js and Express GraphQL API for books and authors. By the end of this video you will have a complete understanding of what GraphQL is and how to use it.
    Code For This Video:
    github.com/Web...
    Twitter:
    / devsimplified
    GitHub:
    github.com/Web...
    CodePen:
    codepen.io/Web...
    #GraphQL #WebDevelopment #JavaScript

Комментарии • 694

  • @WebDevSimplified
    @WebDevSimplified  5 лет назад +270

    I really enjoyed making this GraphQL video, and would love to make more videos about learning a single topic in one video. Let me know if you have any topics that you would want me to cover in a similiar manner.

    • @AshishKumar-oe5ly
      @AshishKumar-oe5ly 5 лет назад +1

      thanks for making such a wonderful video on graph QL. Could you please make some tutorial on integrating GraphQL with Sails-Mongo application?

    • @johnblyberg4801
      @johnblyberg4801 5 лет назад +6

      Your videos are fantastic because you get right in to it and provide great, real-world applications for the code you're writing. Thank you! My request would be a video or a series of videos on securing your API with JWT and other approaches for authentication, CSRF protection, etc. Thanks!

    • @WebDevSimplified
      @WebDevSimplified  5 лет назад +6

      Thank you for the suggestions. JWT is a topic I want to cover in the nearish future.

    • @StephanDuToit
      @StephanDuToit 4 года назад +1

      Web Dev Simplified hi there, have you been able to create this tut yet? Love your tutorials!

    • @sundeepparuchuru
      @sundeepparuchuru 4 года назад +3

      Can you please make tutorial on apollo server with node js. Couldn't able to find much on web.

  • @JuanGutierrez-qg4zr
    @JuanGutierrez-qg4zr Год назад +65

    All these channel videos are gems. By the way, if somebody else is facing the error "TypeError: expressGraphQL is not a function" just replace the import from
    const expressGraphQL = require("express-graphql");
    to
    const { graphqlHTTP } = require("express-graphql");

  • @dougiehawes916
    @dougiehawes916 4 года назад +736

    const expressGraphQL = require("express-graphql");
    -- should be --
    const { graphqlHTTP } = require("express-graphql");
    I kept getting an error till I looked up the documentation

    • @vivek8270
      @vivek8270 4 года назад +2

      Thanks man.

    • @shujabakhtiar8139
      @shujabakhtiar8139 4 года назад +2

      thanks man that helped

    • @iamlande3979
      @iamlande3979 4 года назад +5

      omg thank u, half an hour I was trying to figure out what is wrong

    • @FalseDev
      @FalseDev 4 года назад +4

      Great help, using typescript would have saved some time, and it's because they've make some breaking changes

    • @sahelee1
      @sahelee1 4 года назад +64

      yes. alternatively :
      const expressGraphQL = require('express-graphql').graphqlHTTP
      require('express-graphql') returns an object with a property called graphqlHTTP that is the function you want to call.

  • @laffytaffykidd
    @laffytaffykidd 4 года назад +47

    As an FYI -- You can run `npm init -y` and it will enter in all default values for you :) Hope that helps. Fantastic video. I love your explanations!

    • @christiant.g.994
      @christiant.g.994 2 года назад +7

      But who doesn't love a good button mash 😂😂

    • @saddacracker
      @saddacracker Год назад

      Ha! I didn’t know that! Thank you!

  • @Failedenterprises
    @Failedenterprises 4 года назад +102

    mans straight out of the twilight saga

  • @arnoldtanjunhan
    @arnoldtanjunhan 4 года назад +10

    Didn't know anything about GraphQL, so glad this was the first video I watched. Such a great exposition. Thanks!

  • @andrewbrower4158
    @andrewbrower4158 Год назад +2

    This video walkthrough explains GraphQL in such a crystal-clear way. Not surprised to see high-quality content coming from WDS. Thanks for this excellent tut

  • @steveroseik
    @steveroseik Год назад

    I Have wasted like 4-8 hours minimum with many tutorials, none of them provide full explanation and implementation clearly, yours was straight to the point, understandable and magically easy to comprehend and apply, love it.

  • @LeHuffy
    @LeHuffy 5 лет назад +17

    This was great! I finally finished my web development bootcamp and just landed a job as Front-end Developer for a dream company of mine! Your videos have helped a ton! Thanks for everything man and keep up the great videos!

    • @WebDevSimplified
      @WebDevSimplified  5 лет назад +2

      Congratulations! That is amazing. Nice job putting in all the hard work. How was the boot Camp experience for you? Did you feel you learned a lot?

    • @LeHuffy
      @LeHuffy 5 лет назад +3

      @@WebDevSimplified The bootcamp was a great experience, I've been doing web development since high school so I had a background in it prior to starting it. Everything came pretty quickly to me and I was able to easily understand the advanced concepts easier having had that prior experience. However, alot of others had no experience and the advance concepts where too hard for some people to grasp. I tried my best to get there before class and stay after class to tutor people though. Overall, it was a way for me to figure out the best path and what to learn in order to become employee ready.

    • @WebDevSimplified
      @WebDevSimplified  5 лет назад +3

      @@LeHuffy That's amazing. I am really glad that it went so well for you, and that you were able to help others along the way. I wish you the best of luck with your future career.

    • @LeHuffy
      @LeHuffy 5 лет назад +2

      @@WebDevSimplified Thanks man, appreciate it! Keep up the great videos!

    • @levos2007
      @levos2007 5 лет назад

      @@LeHuffy how long does it take?

  • @richardw2977
    @richardw2977 2 года назад +3

    Hell of a crash course. Great info without talking down to your audience. Been in software for a long time and just now needing GraphQL for a job. I appreciate the in-depth overview without explaining what an IDE is (and other such nonsense). 🤣🤣

  • @skillfulones9495
    @skillfulones9495 5 лет назад +24

    Great tutorial. GraphQL is starting to make sense from watching this.

  • @matthewzamat3331
    @matthewzamat3331 2 года назад +4

    Seriously, thank you. You did a great job explaining a fairly complex topic, and made it really make sense in the context of the application you built. Great job, and please do keep making these types of videos. I think I speak for everyone when I say thank you!

  • @shonoma
    @shonoma Год назад

    3 minutes into this video and I'm already learning so much more than struggling through countless google searches.
    Thank you for this video!

  • @stevestizzy
    @stevestizzy 2 года назад +3

    Great explanation mate.
    Was looking for a simple video tutorial to understand the basics of GraphQL, because I was bored to read any written tutorials at the moment,
    and this was such a great video.
    Thanks

  • @billieporter156
    @billieporter156 2 года назад

    Mr. Web Dev Simplified, your channel has helped me SOOO much. You are a natural teacher. I hope these videos are making you rich and you're driving something really spiffy (like a gold-plated Sion) and that you have a swimming pool with a floating bar, which is what we are all aspiring to.

  • @brunomenezes4937
    @brunomenezes4937 9 месяцев назад +2

    This is a very helpful video to learn the basics of building a graphql server. Very well presented! Try coding along with the presenter.

  • @SmartShorts4You
    @SmartShorts4You 3 года назад +1

    A great brief tutorial, I think I fell in love with GraphQL now, thank you!

  • @latinacoder
    @latinacoder 4 года назад +7

    Your skill for explaining these complex topics is impressive. Thanks for the tutorial

  • @richnimbu
    @richnimbu 2 года назад +2

    I always enjoy your teaching style. So clean and clear. Great content. Thank you!

  • @dannydenenberg
    @dannydenenberg 4 года назад

    I can't tell you how nice it is to watch videos that cut out the bulls***
    Thanks so much!

  • @Grillingforalivin
    @Grillingforalivin 4 года назад +1

    Awsome Video to get up and running with GraphQL. I would suggest turning off the tooltip hint in VSCode as this makes it more difficult to see the code you are typing. Thanks for the video :)

  • @hafuus
    @hafuus Год назад

    i love how this guy simplify everything, thank you

  • @novus9542
    @novus9542 4 года назад +1

    Damn. This is a MUST SUBSCRIBE channel. Awesome tutorial, easy and fast. Great job!

  • @aishwaryasivakumar6425
    @aishwaryasivakumar6425 4 года назад +4

    This should be on the top.
    THANK YOU! 🔥

  • @bryanstrader1740
    @bryanstrader1740 4 года назад +1

    This video was well done, the pace and material were perfect for an intro into GraphQL.

  • @cheatman05
    @cheatman05 4 года назад +1

    I'm new to the world of GraphQL and this was really helpful! Thanks for making this crash course

  • @madhutammu2209
    @madhutammu2209 Год назад

    You never Disappoint with your videos , thank you

  • @StartersammlerXL
    @StartersammlerXL 5 лет назад +3

    Thanks for the amazingly easy explanation of that topic! Best one I've found! Greetings from Germany 🙏🏼

  • @techupdates9166
    @techupdates9166 Год назад

    Really your videos on youtube about development is so helpful Kyle! we are so lucky. Specially thanks👌👍

  • @kritikamamtagaur6968
    @kritikamamtagaur6968 Год назад

    I really enjoyed this video and the way you explain was excellent I was having too many query about GgraphQL those all things cleared for me now. Thank you.

  • @eddiejaoude
    @eddiejaoude 5 лет назад +4

    Really interesting. I haven’t used it before, but I can see why it’s so popular 👍🤓

    • @WebDevSimplified
      @WebDevSimplified  5 лет назад +1

      You've got to check it out. It is really fun when it finally clicks.

  • @davidofug
    @davidofug 2 года назад

    The simplest GraphQL tutorial there is.
    Thank you

  • @mayankvora8116
    @mayankvora8116 2 года назад

    Excellent Explanation and in 40 mins you explained all necessary concepts.

  • @HACKINGMADEFUN
    @HACKINGMADEFUN 2 года назад

    I always wanted to look into GraphQL and found your video today. This is so cool and thanks a lot for making this...

  • @usmanbradley
    @usmanbradley 3 года назад +12

    08:30 const expressGraphQL = require('express-graphql').graphqlHTTP;

  • @leszekmodrzejewski7372
    @leszekmodrzejewski7372 Год назад

    This guy fully deserves over a million subscribers.

  • @interesting_stuffs
    @interesting_stuffs 2 года назад

    GraphQL learned in < 40 mins, Fab!👌

  • @mastercode7851
    @mastercode7851 3 года назад

    well good explanation is grapql gives you exactly what you want in a clean way exactly like this channel did straight forward and clean short video explanation

  • @mohitsoni4925
    @mohitsoni4925 4 года назад +1

    Explained really well, I understood everything and was able to make my own example after watching this. Thanks for your efforts.

  • @jacquitratongamanahaja979
    @jacquitratongamanahaja979 2 года назад

    Thank you so much bro for this video, it helps me a lot to grasp Graphql.

  • @lafenlesley2935
    @lafenlesley2935 2 года назад

    I used to think GraphQL brought some sort of complexity to your application. After watching this, I realized how far from the truth I was. Imma use it in every application henceforth.. Thanks for the vid, you are awesome!

  • @rovixen8668
    @rovixen8668 2 года назад

    there is another version for constructing the object type with a string... but i really really REALLY prefer the way you do it in the video XD

  • @aakashggujju
    @aakashggujju 4 года назад

    Amazing Amazing tutorial on GraphQL and this is just that I was looking for getting quick understanding on this amazing amazing technology. Also your teaching style is just an awesome and I really loved it. Thanks

  • @АльбинаАлебастрова

    Cool explanation, I’m a front end developer from 🇷🇺 Thanks a lot

  • @nastula-dev
    @nastula-dev 2 года назад

    Thanks, that's pretty dope tech and you've done very well explaining it, kudos!

  • @continental_drift
    @continental_drift 3 года назад

    Great video.
    Simple explanations of a complex subject including data normalization.

  • @chauhanvipul2009
    @chauhanvipul2009 4 года назад

    I would like to thank you for your awesome tutorial.
    You make it really easy to understand and not boring at all.
    Please keep going you're doing great !!! What's your good name, please?

  • @mxruznet1
    @mxruznet1 3 года назад

    A very important point is made on circular referencing (ReferenceError) at 31:13

  • @albin1568
    @albin1568 4 года назад

    9.5/10 Well made video. Only improvement would be to skip the Hello World part and just jump straight into the books and author

  • @richardbenes9
    @richardbenes9 2 года назад

    Thanks for a good explanation.
    Queries, schemas.. It reminds me so much of SQL.

  • @MasterSergius
    @MasterSergius 3 года назад

    Another one tool to be asked on a technical interview ;)

  • @SushilYadav7
    @SushilYadav7 4 года назад

    Please make videos on code refactoring/clean code. You can make a series of short videos where you pick one code smell and you can explain why it is bad and how we can remove it. (Please use Java language if you are going to make videos on this topic)😀

  • @bashardlaleh2110
    @bashardlaleh2110 3 года назад

    Fantastic ! you nailed it in 40 minutes

  • @africanbuffalo
    @africanbuffalo Год назад

    Excellent tutorial! Thank you!

  • @brysonsullivan6265
    @brysonsullivan6265 3 года назад

    It is a good video. Although It would have been better to make it a little bit longer and go more into detail about what some of the imports are doing. Some of the topics you just rush through as if everyone has great knowledge of GraphQL!

  • @Ralphflowers
    @Ralphflowers 2 года назад

    When are you gonna start making courses? You really good at teaching

  • @codebitcookie8053
    @codebitcookie8053 2 года назад

    This was amazing. Thanks for all the free info!

  • @afganhalilov1442
    @afganhalilov1442 Год назад +1

    Cant understand clearly the difference between REST because in the first example we can do the same with REST
    for example:
    getAuthorsAndHisBooks
    then we do some joins in our SQL and return the authors array with his books array in each author element

  • @nischalgautam4969
    @nischalgautam4969 Год назад +2

    const { graphqlHTTP: expressGraphQL } = require("express-graphql");
    the expressGraphQL function has been renamed to graphqlHTTP. replace with the above code

    • @RemoViky
      @RemoViky Год назад

      Thanks :), I was looking for that . BTW why we typing like this {graphqlHTTP: expressGraphQL}? . Can u please explain what is syntax means? Thanks

  • @NicholasRogersMN
    @NicholasRogersMN Год назад

    Great video! Very easy to follow, a great entry point into GraphQL

  • @brandonmarks6
    @brandonmarks6 6 месяцев назад +1

    I am still a little unclear on how graphQL improves efficiency in some ways. For example, under fetching, I can see how from the front end it seems like you were only getting the data you need, but my understanding of it is the graphQL service we made will still fetch all authors and books from the "backend" and it then just filters them before the frontend receives it. I recognize that this makes it much simple to work with in the front end, but is it really an efficiency improvement if it still gets more data then necessary from the backend and filters it in the graphql service? If anyone has an explanation of this or needs me to further clarify this questions please let me know!

    • @Hurricane28110
      @Hurricane28110 5 месяцев назад +1

      The only thing I can think of is, it reduces the amount of end point the backend guys will need to create for specific data requests or the part of handling the data as you mentioned by the frontend and all the filter stuffs will just be done by graphql, less code.

  • @ljbrown238
    @ljbrown238 3 года назад

    Outstanding work! Very helpful!!!

  • @cotixmol
    @cotixmol Год назад

    Great video!
    As an advice try to go at a slower pace. It may take a little longer to do but the concepts will be a lot clearer.

  • @adewolefavour7220
    @adewolefavour7220 5 лет назад

    @Web Dev Simplified You are simply AMAZING for this!!! Keep up the good work bro

  • @marlon4008
    @marlon4008 4 года назад

    you are the best teacher!!

  • @nayandey9112
    @nayandey9112 5 лет назад

    Great explanation.
    And Great Work.
    Keep up good working.Best Wishes.

  • @Yolo-yb1nd
    @Yolo-yb1nd 3 года назад

    Thank you!! This tutorial is super helpful and clear!!!

  • @mario1ua
    @mario1ua Год назад

    Great explanation, really laconic and clear

  • @reducer2681
    @reducer2681 2 года назад

    This is just awesome! Thanks a lot!!

  • @georgetuccio6053
    @georgetuccio6053 2 года назад

    Awesome Kyle. Thank you.

  • @akrititewari9695
    @akrititewari9695 4 года назад

    Very interesting and fairly simple to understand! Thanks for you effort :)

  • @jaredmeit6127
    @jaredmeit6127 2 года назад

    This is an amazing tutorial. Thank you!

  • @arlangalvez7312
    @arlangalvez7312 Год назад

    Thank you for this awesome video!!!

  • @ApoorvPandeyDev
    @ApoorvPandeyDev 2 года назад

    Superb! Helped me a lot

  • @ichigokotetsu9540
    @ichigokotetsu9540 2 года назад

    AKG microphone, good man :D

  • @mohammedlaniyan4339
    @mohammedlaniyan4339 2 года назад +1

    The Static DB values:
    const authors = [
    { id: 1, name: 'J. K. Rowling' },
    { id: 2, name: 'J. R. R. Tolkien' },
    { id: 3, name: 'Brent Weeks' }
    ]
    const books = [
    { id: 1, name: 'Harry Potter and the Chamber of Secrets', authorId: 1 },
    { id: 2, name: 'Harry Potter and the Prisoner of Azkaban', authorId: 1 },
    { id: 3, name: 'Harry Potter and the Goblet of Fire', authorId: 1 },
    { id: 4, name: 'The Fellowship of the Ring', authorId: 2 },
    { id: 5, name: 'The Two Towers', authorId: 2 },
    { id: 6, name: 'The Return of the King', authorId: 2 },
    { id: 7, name: 'The Way of Shadows', authorId: 3 },
    { id: 8, name: 'Beyond the Shadows', authorId: 3 }
    ]

  • @thyagobrod
    @thyagobrod 3 года назад

    Very helpful, thank you very much!

  • @karandidwani
    @karandidwani 4 года назад +1

    Great Video
    But I would like to point out 2 things
    1) In the real world, we might always need to connect it to DB, so when the tech is so much dependant on it, I think you should include it. If DB connection and querying was there, this was 100% complete
    2) The font size on the GraphiQL was lil smaller
    Just some positive feedback, it was almost perfect :)

    • @elephant_888
      @elephant_888 4 года назад

      Naah! When I was initially learning graphQL I may have agreed with you, but it’s MORE import to remember that your data-source can be ANYTHING at all.
      Anything that has state/data can act as a GraphQL data source. External (local or remote) files, rest apis, OS system state, application state, another graphQL API, sensors... and also a database. 😉
      Understanding the fundamentals of GraphQL is a lot more important than wasting time on integrating a database and making it look like a “real” project.

  • @omarsuriel1112
    @omarsuriel1112 3 года назад

    Hey brother. Can you make a video talking about subscription and how to implement them in a way that the servers can be scaled horizontally

  • @ujjalzaman2722
    @ujjalzaman2722 3 года назад

    Thank you so much for explanation.

  • @sreeganesh4082
    @sreeganesh4082 4 года назад

    The best Channel

  • @herrflantier3739
    @herrflantier3739 3 года назад

    Very helpful! Thanks!

  • @SagarSharma-lx1hy
    @SagarSharma-lx1hy 4 года назад

    Awesome tutorial. Thank you for making it.

  • @stardustmotion
    @stardustmotion 3 года назад

    amazing, thank you for making it much easier

  • @bhawanachaudhary3976
    @bhawanachaudhary3976 2 года назад

    Thankyou so much .Its really helpful.

  • @arifkhan-bj6kr
    @arifkhan-bj6kr 3 года назад

    Great tutorial for beginners.

  • @krishnaverma7744
    @krishnaverma7744 4 года назад

    super explanation.....good job

  • @jeffz7310
    @jeffz7310 10 месяцев назад +1

    best tutorial

  • @webcodeexplainedYT
    @webcodeexplainedYT Год назад

    We can send array of IDs to get the books information using Rest API /authors/:ids/books as well right ?

  • @ghost91827
    @ghost91827 4 года назад

    Excellent content with good explanation

  • @9429963654
    @9429963654 3 года назад +5

    08:21 I thought it would error out on app.listen() because the port was passed as `5000[dot]`
    But it did not! Funny

  • @WingXBlade
    @WingXBlade 2 года назад

    what happens when you query the author field within books which reference the author field? Will the server crash due to the circular reference?

  • @efosao.jeffrey1922
    @efosao.jeffrey1922 2 года назад

    Awesome video!

  • @pareshmaniyar8273
    @pareshmaniyar8273 2 года назад

    It does reduce the network calls but does it reduce the DB calls? I don't think it does but If it does, it would be awesome!

  • @none0n
    @none0n 3 года назад

    Great video. I just subscribed!

  • @AvielCo_
    @AvielCo_ 3 года назад

    That's amazing.
    Thank you so much!

  • @SandwichMitGurke
    @SandwichMitGurke 3 года назад

    thanks. this is a f*ing good tutorial

  • @jakejohn7619
    @jakejohn7619 Год назад

    one question,so does that mean if we want to add multiple authors and multiple books,we need to run the mutation several times?

  • @herorajraj
    @herorajraj 3 года назад

    Is GraphQL an alternative to REST APIs ? Or Does it work on top of REST APIs ? Please explain.

  • @psybitcoin
    @psybitcoin 4 года назад

    Amazing video! Keep it up!