GraphQL API with .NET 5 and Hot Chocolate

แชร์
ฝัง
  • เผยแพร่เมื่อ 4 ก.พ. 2021
  • In this step-by-step tutorial I take you through how build a GraphQL API using C#9, .NET 5 and the Hot Chocolate framework.
    The video covers:
    - Application Architecture Overview
    - GraphQL theory and core concepts
    - Building Queries
    - Multi-threaded queries using Pooled DBContextFactory
    - Sorting & Filtering
    - Building Mutations
    - Building Subscriptions (real-time event notifications with Web Sockets)
    Level: Intermediate
    📕 My Book: www.apress.com/gp/book/978148...
    🤩 Patreon Site (Exclusive Member Benefits!): / binarythistle
    📕 Webhooks Course on Udemy: www.udemy.com/course/webhooks...
    💻 GitHub Repo: github.com/binarythistle/S04E...
    🔗 WSL Install: docs.microsoft.com/en-us/wind...
    🔗 Installing Docker in WSL: docs.docker.com/docker-for-wi...
    🔗 Visual Studio Code: code.visualstudio.com/download
    🔗 SQL Server Express: www.microsoft.com/en-au/sql-s...
    🔗 Visual Studio: visualstudio.microsoft.com/do...
    🔗 Insomnia: insomnia.rest/
    🔗 SQL Server on Docker: hub.docker.com/_/microsoft-ms...
    🔗 SQL Server Management Studio: aka.ms/ssmsfullsetup
    🔗 GraphQL Voyager: github.com/APIs-guru/graphql-...
    🔗 GraphQL Official Site: graphql.org/
    🔗 Chilli Cream / Hot Chocolate Site: chillicream.com/
    ⏲️ Time Codes ⏲️
    PART 1 - INTRODUCTION
    - 0:48 Welcome
    - 2:38 Demo
    - 11:10 Course Overview
    - 14:03 Architecture
    - 17:15 Ingredients
    PART 2 - THEORY
    - 19:26 What is GraphQL?
    - 20:17 GraphQL Core Concepts
    - 24:22 REST Vs GraphQL
    - 31:22 GraphQL Frameworks in .NET
    PART 3 - CODING PART 1
    - 33:42 Environment Setup
    - 38:44 Project Setup
    - 47:58 Setup SQL Server with Docker
    - 58:29 Configuration & Dependency Injection
    - 1:10:41 Set up our 1st Model
    - 1:14:20 Setup DB Context & Connection String
    - 1:25:44 Migrate to DB
    - 1:32:45 Create GraphQL Query
    - 1:37:33 Configuring GraphQL Services (Startup Class)
    - 1:38:54 Configuring GraphQL in Request Pipeline ()
    - 1:40:03 Querying our endpoint with Banana Cake Pop & Insomnia
    - 1:51:39 Setting up and using GraphQL Voyager
    - 1:57:55 Concurrent quering issue
    - 2:02:10 Introducing the Pooled DbContext Factory
    PART 4 - CODING PART 2 - EXTENDING OUR QUERIES
    - 2:06:49 Adding our 2nd Model
    - 2:10:51 Update DBContext & Migrate
    - 2:17:41 Querying with multi-model - using projection
    - 2:24:40 Adding a Commands Query
    - 2:28:44 Adding in-line documentation to our API
    - 2:32:46 Annotation Vs Code First approaches
    - 2:38:51 Adding a Platform Type with Resolver
    - 2:51:08 Adding a Command Type with Resolver
    - 3:00:11 Sorting & Filtering capabilities
    PART 5 - CODING PART 3 - MUTATIONS & SUBSCRIPTIONS
    - 3:07:05 Introducing Mutations & Adding Platforms
    - 3:17:16 Testing our Platform Mutation
    - 3:22:37 Adding a Commands Mutation
    - 3:30:46 Testing our Commands Mutation
    - 3:34:08 Adding Subscriptions (Real-time events)
    - 3:43:01 Testing our Subscription
    PART 6 - WRAP UP
    - 3:45:23 Wrap up and Final thoughts
    - 3:46:48 Patreon Supporter Credits

ความคิดเห็น • 333

  • @81NARY
    @81NARY 3 ปีที่แล้ว +75

    Tip: If you add a 00:00 time code in your description, then youtube will automatically add chapters to the video.

  • @andreistelian9058
    @andreistelian9058 ปีที่แล้ว +2

    For someone who is doing this app in dotnet 7 and has errors after creating the PlatformType, you need to put the [Parent[ attribute in front of the GetCommands method from the Resolvers class.
    This is a breaking change in the framework of HotChocolate

  • @trpeel27
    @trpeel27 3 ปีที่แล้ว +1

    This was incredible. Thank you for such detail. This is the only example I've found that walked you through end-to-end. It was perfect!

  • @dallasthornton2374
    @dallasthornton2374 2 ปีที่แล้ว

    This is quality work. It's sat in my list for the last year and I finally got around to watching it since I'm starting to mess around with GraphQL and it's still pretty helpful even though I'm not using Hot Chocolate

  • @namanvohra8262
    @namanvohra8262 2 ปีที่แล้ว +2

    There is no doubt that this is the best tutorial out there. Thank you so much Les for also taking the time to explain the things clearly. You just gained a new subscriber.

  • @oswaldumeh
    @oswaldumeh 3 ปีที่แล้ว +2

    This is the best GraphQL tutorial yet I have watched online. Very detailed with well-explained concepts. Thanks for this awesome work!

  • @OctarineFoundry
    @OctarineFoundry 2 ปีที่แล้ว +1

    A lot of tutorials on tech topics fly over the "obvious stuff". I really appreciate that you take the time to go into the details of each step but remain concise. Great video thanks.

  • @markybolton
    @markybolton ปีที่แล้ว +1

    I love his tutorial! His teaching mannerism is so assuring and easy to follow. Best instructor ever!

  • @zulhishamtan4308
    @zulhishamtan4308 3 ปีที่แล้ว

    Thank you Les, this is awesome, your step by step tutorial is really precise as you type while you going along. I have learned a lot and I like GraphQL.

  • @michaelpalgon3459
    @michaelpalgon3459 ปีที่แล้ว

    Outstanding tutorial. Love how you hand code everything instead of magically pasting in code.

  • @Etheregod
    @Etheregod 3 ปีที่แล้ว

    I love your tutorials. Thank you for sharing this quality videos for free here. Actually you are helping me a lot with my APIs and I am falling in love with the backend part of programming!

  • @georgcordes5909
    @georgcordes5909 3 ปีที่แล้ว

    Hi Les! Love your voice, your beart, the accent and the way you're teaching us all that interesting stuff! Keep up your good work! For me it is "learning with a smile" and makes it easier then elsewhere! Greetings from Hamburg to Melbourne!

  • @geeksy2278
    @geeksy2278 3 ปีที่แล้ว

    Currently we are switching our tech stack and your videos are pure gold. Thank you very much

  • @snehgour9711
    @snehgour9711 ปีที่แล้ว

    Always enjoy your all tutorials !!!!!!😀

  • @PlayRiteProductions
    @PlayRiteProductions 3 ปีที่แล้ว +6

    Welcome back bro! Keep up the awesome content! You're a great teacher.

  • @fieryscorpion
    @fieryscorpion 3 ปีที่แล้ว +17

    For someone struggling with the voyager setup, this is how it worked for my version of 5.0.2:
    app.UseGraphQLVoyager(new VoyagerOptions()
    {
    GraphQLEndPoint = "/graphql",
    }, "/graphql-voyager");

    • @Mattzard
      @Mattzard 3 ปีที่แล้ว +2

      Thanks for this - the "Path" property also doesn't exist, it seems to be set as default to this:
      - localhost:5000/ui/voyager

    • @henryuta
      @henryuta 3 ปีที่แล้ว +1

      THANKS! I burned an hour on this and could not move on.

    • @naufilshaikh09
      @naufilshaikh09 3 ปีที่แล้ว

      Thanks

    • @Brickscrap
      @Brickscrap 2 ปีที่แล้ว +1

      Thank you for this!

    • @Merilix2
      @Merilix2 2 ปีที่แล้ว

      I guess the now supposed way is:
      after
      endpoints.MapGraphQL();
      insert
      endpoints.MapGraphQLVoyager("/graphql-voyager");

  • @Mattzard
    @Mattzard 3 ปีที่แล้ว +1

    I have just completed this video and can confirm this was such a great introduction to GraphQL, thank you so much! I agree with another commenter that another video on the advised or suggested ways to query this new API from a frontend perspective would be great too. Thanks again!

  • @wilfredoguardado2712
    @wilfredoguardado2712 3 ปีที่แล้ว

    Thanks for taking your time to make up learning in a easy way!
    Definitely I recommend this video!

  • @davewasthere
    @davewasthere 2 ปีที่แล้ว +1

    These are such high quality videos, I love it!

  • @RomanSuska
    @RomanSuska 3 ปีที่แล้ว

    Good timing, was just looking for some materials to learn graphql. I will definitely take your course. Good to see you again :)

  • @andrewobrian441
    @andrewobrian441 3 ปีที่แล้ว +2

    What a mad lad! Thank you so much for these great videos, learning with you is so much easier 😊 👍👍

  • @ankurmittal9734
    @ankurmittal9734 3 ปีที่แล้ว +3

    Was missing you and your awesome way of teaching.. hope will get many more this year..

  • @tuberklz
    @tuberklz 3 ปีที่แล้ว

    subscriptions blew my mind. and also i am very opt in to the idea of starting type-less. after agreeing on the basics with the business representatives, one can quickly provide added complexity.
    kudos man. thanks for all the effort you put on this.

  •  3 ปีที่แล้ว +2

    I just want to say: This is awesome!!!

  • @AndresZumelzu
    @AndresZumelzu 3 ปีที่แล้ว +11

    Hi Les, thanks for this great course! I didn't finish it yet, I'm on my way :). I would like to mention one thing I found when running a profiler for sql server: when using ObjectTypes (for Platform and Commands) and doing the heavy lifting manually, there are three queries executed against the database (one per platform id). But if I use the default behavior, there is only one. I think that's worth noting. Thanks!!

  • @JarredJ
    @JarredJ ปีที่แล้ว

    Les, Thank you so much for your informative tutorials. I did the one on API and Microservices and now GraphQL API and they are so helpful. Your teaching style is great and I have learnt a lot from you.

  • @panirajn
    @panirajn 3 ปีที่แล้ว

    Thanks a lot for the teaching in simplest way!

  • @OdieFighter
    @OdieFighter 3 ปีที่แล้ว

    i'm not a dotnet developer but i was thrown headfirst into it cause of work, ur videos on it and the way u explain things really helped me a ton!
    i just wanna say thanks for making them ~!

  • @niezebenmansour3736
    @niezebenmansour3736 ปีที่แล้ว

    Amazing tutorial, thank you!

  • @2005bgva
    @2005bgva 3 ปีที่แล้ว +1

    Les it is fantastic to see you again on youtube.

  • @karinn7163
    @karinn7163 2 ปีที่แล้ว +1

    Amazing tutorial, very clear, thank you

  • @ankurkumargoell
    @ankurkumargoell ปีที่แล้ว

    I have not seen such a detailed video on GraphQL. Trainer knowledge is very good.

  • @user-mc5lb8kb1v
    @user-mc5lb8kb1v ปีที่แล้ว

    very useful, thanks for this great course!

  • @code3658
    @code3658 3 ปีที่แล้ว +6

    Nice tutorial. I learned a lot. Please create a video about authentication and authorization stuff with GraphQL.

  • @cutthecode2784
    @cutthecode2784 3 ปีที่แล้ว

    awesome !! OMG... I watched the whole 3:45 hours continuously without getting tired

  • @bencejuhasz2938
    @bencejuhasz2938 2 ปีที่แล้ว

    Thank you very much Les for this awesome course!

  • @bijulal3906
    @bijulal3906 2 ปีที่แล้ว

    Hi Les, Nice presentation . Feels like a live session. Thank you.

  • @BrunSwick33
    @BrunSwick33 3 ปีที่แล้ว

    Excellent course/video. It also came at a great time since we are looking to implement graph with our .net 5 APIs. We will be looking to combine rest and graph but this will help a ton.

  • @marcoalfaroazofeifa
    @marcoalfaroazofeifa 2 ปีที่แล้ว

    I believe I will become a fan of your presentations Les. Great work!

  • @SajidAliSoftwareEngineer
    @SajidAliSoftwareEngineer 2 ปีที่แล้ว

    Amazing and detailed video, I learn first-time Graphql
    Thank you so much Les Jackson. ❤️

  • @martinnjoroge9789
    @martinnjoroge9789 2 ปีที่แล้ว +1

    Thanks for the tutorial. Watched and implemented to the end. Everything worked fine. Thanks once again @Les Jackson

  • @ifanzalukhu97
    @ifanzalukhu97 2 ปีที่แล้ว

    Thanks Les Jackson for awesome tutorial.

  • @sharifabdullahrifatsoftwar9816
    @sharifabdullahrifatsoftwar9816 3 ปีที่แล้ว

    The Most effective Tutorial I have ever seen on GraphQL. I was thinking of buying a tutorial in Udemy. Now I think I don't need it. Thanks a lot

  • @OvRaf
    @OvRaf 2 ปีที่แล้ว

    amazing tutorial! thanks a ton, Les!

  • @ArtyomAvetisyan5
    @ArtyomAvetisyan5 3 ปีที่แล้ว

    Finally a guy who is happy with 2020!

  • @arunnaveenkumar
    @arunnaveenkumar 3 ปีที่แล้ว +1

    Thanks for Tutorial. Love way of your teaching 👍

  • @raouftoumi6669
    @raouftoumi6669 3 ปีที่แล้ว

    Offf, Finally a new video on my favorite channel👏🤩

  • @deepakkumar-cl6hs
    @deepakkumar-cl6hs 2 ปีที่แล้ว +1

    This is Superb Tutorial, Well presented . Les hat off to your effort and passion in teaching every bit of details in such a structure and easy format. I loved this video and have become fan of your channel.
    Keep up the good work .
    Many thanks

  •  2 ปีที่แล้ว

    This is a great one! Thanks, Les.

  • @lemurza5236
    @lemurza5236 3 ปีที่แล้ว

    Your content is the best. Thank you

  • @NguyenNguyen-ly2yt
    @NguyenNguyen-ly2yt ปีที่แล้ว

    Thank you for your course!

  • @vamvdotnet
    @vamvdotnet ปีที่แล้ว

    In this video, I learned a lot from you, Les. Thank you very much!

  • @vladyslav.papirnyi
    @vladyslav.papirnyi 2 ปีที่แล้ว

    Good tutorial for GraphQL novices. Thank you

  • @bhuvaneshnarayanasamy3153
    @bhuvaneshnarayanasamy3153 3 ปีที่แล้ว

    Fantastic production and awesome tutorial, I followed along and created the same, very much apricated for your efforts.

  • @AmazingTechwithSuhas
    @AmazingTechwithSuhas 2 ปีที่แล้ว

    Thank you for such a superb starter video. Hot Chocolate seems promising

  • @neilgilroy1629
    @neilgilroy1629 2 ปีที่แล้ว

    Thanks so much for this great video. Merry Christmas!

  • @orochinagi1111
    @orochinagi1111 2 ปีที่แล้ว

    great song at the end too :) perfect sized course

  • @serkanprlk
    @serkanprlk 10 หลายเดือนก่อน

    Amazing. Thank you for your help pretty much

  • @jamiesimm2735
    @jamiesimm2735 3 ปีที่แล้ว

    Fantastic video as always Les

  • @jurekwoz
    @jurekwoz 2 ปีที่แล้ว

    Awesome video! Thanks!

  • @naufilshaikh09
    @naufilshaikh09 3 ปีที่แล้ว

    Woaah, amazing video. learned lots of new things. Thanks Les.

  • @MichaelPeto
    @MichaelPeto 3 ปีที่แล้ว +3

    This has to be one of the best tutorials I have ever watched. Thanks for putting it together!

  • @oleksiylevenets8161
    @oleksiylevenets8161 2 ปีที่แล้ว

    Awesome tutorial!!! Thank you very much!!!!

  • @rmclean101
    @rmclean101 3 ปีที่แล้ว

    Awesome, thank you for another wonderful video!

  • @programmingskills3404
    @programmingskills3404 3 ปีที่แล้ว

    you teach very well man

  • @sirparcival9500
    @sirparcival9500 3 ปีที่แล้ว

    Awesome tutorial. Thank you

  • @sarinasalim2494
    @sarinasalim2494 ปีที่แล้ว +1

    One of the best tutorials I’ve seen. Coming from zero knowledge of graphql I feel at least now I understand the concepts backed by hands on examples. Thank you. Count me in as a new subscriber.

  • @evanhl4878
    @evanhl4878 3 ปีที่แล้ว +1

    Just started your Udemy course. Love it!

  • @captainmujheri
    @captainmujheri 2 ปีที่แล้ว

    oh man, You made creating API in .net core so easy by making this video

  • @facilitatecollaboration7829
    @facilitatecollaboration7829 2 ปีที่แล้ว

    It was fantastic, really helpful!

  • @nestormatias217
    @nestormatias217 3 ปีที่แล้ว

    Thank you Les it was an awesome to start on GraphQL i learned a lot very greatfull with your videos they are large but they worth it

  • @KhanhNguyen-pq6kn
    @KhanhNguyen-pq6kn 2 ปีที่แล้ว

    Many thanks for really helpful and detailed education content... took a lot from this tutorial and git repo

  • @peculiarpeculiar2504
    @peculiarpeculiar2504 2 ปีที่แล้ว

    Intro always epic.

  • @piotrkowalski1564
    @piotrkowalski1564 2 ปีที่แล้ว

    Great tutorial, thanks!

  • @NikosMiliotis
    @NikosMiliotis 2 ปีที่แล้ว

    Les, that was an amazing Course. Thanks you very much.

  • @vitaliik8315
    @vitaliik8315 3 ปีที่แล้ว

    I used hot chocolate - it's awesome! Thanks for video!

  • @rabinbyanjankar1310
    @rabinbyanjankar1310 3 ปีที่แล้ว +10

    This is really great presentation. Would be great if you could include the pagination support as well.

  • @raghavbuz
    @raghavbuz 3 ปีที่แล้ว

    Very informative and good video. I have gone through it and now will be performing the practical. One request, please upload videos/tutorials at least on monthly basis. Your explanation is simple to follow and in-depth. I really like the way you explain each and every concept. 👌👌👍👍

  • @orochinagi1111
    @orochinagi1111 2 ปีที่แล้ว

    thanks Les!!!!!!!!!! im subbed to your Patreon now :) next stop: microservices course! keep em comin baby

  • @argeelearner3978
    @argeelearner3978 3 ปีที่แล้ว

    Great to see you back

  • @dembasiby
    @dembasiby 3 ปีที่แล้ว

    Waiting this evening to watch the video, but Les, thank you, and Keep up the good work.

  • @khalilaibrahim1278
    @khalilaibrahim1278 2 ปีที่แล้ว

    Thanks for this amazing tutorial

  • @vdrasutis
    @vdrasutis 2 ปีที่แล้ว

    Great video, thanks.

  • @JohnDoe-zt9pp
    @JohnDoe-zt9pp 2 ปีที่แล้ว

    Thanks for this video!!

  • @tyn3561
    @tyn3561 2 ปีที่แล้ว

    Great tutorial mate! I am going to buy your Webhooks tutorial. Thanks a lot!

  • @dzsukov
    @dzsukov 3 ปีที่แล้ว +21

    Amazing tutorial, thank you! What would be awesome is to include a section (or a separate video) on how to handle authorization in GraphQL (both "endpoint-wide" and also user by user/object by object). I know it's a whole different complex can of worms and lots of work, however that's the last piece of info for me to be able to "ditch" REST :) Any chance you would be up to something like that?

  • @sreeram5152
    @sreeram5152 3 ปีที่แล้ว

    Really , Amazing stuff , Good Work ..

  • @Fermerius
    @Fermerius ปีที่แล้ว

    Great stuff. Thanks

  • @user-jg7ly1ib2z
    @user-jg7ly1ib2z 3 ปีที่แล้ว +2

    Thank you from Russia, with love

  • @NJ8991
    @NJ8991 3 ปีที่แล้ว

    wonderful stuff, thank you!

  • @ReyAlexam
    @ReyAlexam 2 หลายเดือนก่อน

    Thank you Les !

  • @dyakobaram
    @dyakobaram 3 ปีที่แล้ว +2

    nice to see you come back :)

    • @binarythistle
      @binarythistle  3 ปีที่แล้ว +1

      Great to be back finally! (Taken a while...)

  • @IVerges
    @IVerges 3 ปีที่แล้ว

    Excellent video. Keep like this dude.

  • @martinkhachatryan3394
    @martinkhachatryan3394 ปีที่แล้ว

    Believe it or not, Mr. Jackson, you built my career, thank you.

  • @tonyhatch3134
    @tonyhatch3134 3 ปีที่แล้ว

    Amazing video thank you!

  • @lambo1707
    @lambo1707 3 ปีที่แล้ว +6

    dev from philippines, your content helps me a lot

  • @josbexerr5166
    @josbexerr5166 3 ปีที่แล้ว

    Gracias Mister Lest Jackson por compartir conocimiento.......saludos de los andes peruanios

  • @homeofcreation
    @homeofcreation ปีที่แล้ว

    Excellent video had to google a breaking change in the HotChocolate 12 update in the Platform and CommandsTypes code, but this is a minor issue. I have implemented Dataloaders which I definitely recommend. Great Job! Thanks!!

  • @Lampego0
    @Lampego0 3 ปีที่แล้ว

    Thank you. Your videos is very helpful for me :)

  • @joaofranco6779
    @joaofranco6779 3 ปีที่แล้ว +2

    Very easy to understand, great voice, great visuals and great pace! Overall, a very good tutorial that is easy to digest and very much worthwhile going through. I only had one slight issue when I couldn't get Voyager to work, other than that every part was flawlessly explained and shown!

    • @toddnedd2138
      @toddnedd2138 3 ปีที่แล้ว +4

      if you are using package GraphQL.Server.Ui.Voyager Version="5.0.1" or higher the following should help:
      using GraphQL.Server.Ui.Voyager;
      public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
      {
      ...
      app.UseGraphQLVoyager(new VoyagerOptions(){
      GraphQLEndPoint = "/graphql"
      });
      }
      default voyager endpoint is "ui/voyager"
      cheers.

    • @rafaelskiba3854
      @rafaelskiba3854 3 ปีที่แล้ว +4

      @@toddnedd2138 This does not work for me.
      But this:
      app.UseGraphQLVoyager(new VoyagerOptions(), "/graphql-voyager");
      You can also omit the path. Then the GraphQL Voyager is accessible via its default: /ui/voyager

    • @fieryscorpion
      @fieryscorpion 3 ปีที่แล้ว +1

      @@rafaelskiba3854 I was googling the hell out of it and still unable to figure it out. Thank you so so much!