React With GraphQL (Apollo Client) Crash Course

แชร์
ฝัง
  • เผยแพร่เมื่อ 6 ม.ค. 2025

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

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

    I watched and practiced most of your videos. Lost of coding-along, frustration and doubts. It all finally cemented into my brain and I breezed through my coding test. Just want to let you know that you upgraded my life 😭😭😭😭

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

    This is the best GraphQL coding-along video I have seen thus far and I am convinced to use it now.😜

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

    Your channel is so underrated. Thanks for all your courses

  • @billy-bund
    @billy-bund ปีที่แล้ว +1

    You're very good at explaining things in an easy to understand way

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

    The way you explain it is just so stunning. It’s simplified at its finest. Very 👍🏻

  • @brajagopal4725
    @brajagopal4725 11 หลายเดือนก่อน

    Best React With GraphQL crash course in TH-cam❤

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

    Enjoy this course so much, easy to understand! Thank you once again Laith =))

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

    I understood more of GrraphQL and Apollo from your video, Thank you

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

    just at the right moment , I'm starting a new project and i'll need to learn graphQl. good mind reader

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

    very easy and very practically explained, great work- loved it👍

  • @keshavsharma-vx8ni
    @keshavsharma-vx8ni 2 ปีที่แล้ว

    one hell of a tutoarial bro it clicked in one shot thanks a lot

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

    A great one to start with. Fewer jargons and clear explanation.

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

    I am so happy that I found your Crash Course because I am so lazy to see courses with higher hours. 😅. This was such a valuable and short course learned... Thank you so much...

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

    thanks, that was exactly what i was looking for, just note , i think even a lazy query can be in a separate custom hook

  • @codingcafe8360
    @codingcafe8360 11 หลายเดือนก่อน

    Amazing course to Learn GQL,
    Thanks to you 💜

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

    Yo bro, this was fucking fantastic! When your course drops in price (due to my lack of money atm), buying it for sure!

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

    Thank you ❤👏👏
    You made the GraphQL sooo easy

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

    Thank you bro. This is really great. I will take it from here with apollo documentation

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

    thank you for clear and detailed explanation

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

    this is the best video for learn graphql client

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

    The crash course I didn't know I needed 💯

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

    10:31 connect react with graphql server through Apollo-Client
    13:06: InMemoryCache: cache the query into cache for next API calls
    18:32 how to qeury from Graphql server

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

    This is a great tutorial. Learnt about the basics of GraphQL pretty quickly. Thanks a lot.

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

    Fantastic free content! Thank you! I just bought your Udemy course. Looking forward to starting it.

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

      Hey @Lane Cunningham. Can you say which course have you bought and share your opinion about it. I really like the way how he teaches and considering buy one of his courses as well. Thanks :)

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

    It's simple and informative. Thanks!!

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

    You makes it easy to me now i'm start to learn it,thanks

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

    Great content, I was able to replicate it with my django graphql endpoint after a few adjustments (mostly datatypes and the react router dom v6 changes). Thank you so much.

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

    It help me a lot this video! Thank you so much!

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

    Really amazing crash crouse, thanks Laith Academy.

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

    This video really helped me. Thank you very much!

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

    You're doing great bro 👊

  • @0xAndy
    @0xAndy 2 ปีที่แล้ว

    Fantastic. Just what I needed.

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

    Question about the lazy querying. I can see that the query was---at first---delayed until we actually selected the "Search" button. However, after you selected it once, it looked like the query was getting executed just when you changed the input and no longer needed to select the "Search" button. For example, ~59 minutes in when you change it from Annie -> Rick Sanchez. Can you explain what's going on here?

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

      Nice question.
      The reason was he use the useState
      Hook.
      If the property "name" is changed in value, the component wil re-render itself.
      He used the search bar onchange function that's why it triggers to change the value "name". Because name is linked to the name property.
      If you care for performance don't do his way.
      There are some techniques that you can do to make it more efficient.
      Overall there are no mistake on his code.
      I hope this help

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

      hey, i had same doubt that behavior kind of makes sense if you think about it.
      i have found the right method
      getLocations({
      variables: {
      name
      }
      });
      instead of passing variable object to hook, pass it when you actually want to call the query. and it will work as expected.
      its been long but I'm posting it if anyone else might have same doubt.

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

    Awesome video. Small problem. When calling the useCharacters() @31.37, error message saying " export 'useCharacters' (imported as 'useCharacters') was not found in '../hooks/useCharacters' (possible exports: default)". And I followed exactly to the video.
    I checked 20 times lol but same problem. Any suggestions?

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

    Awsm content... Really helpful unable to write query for the individual data and it really helped !!
    bte in that variables variables{id: id} short form is used... in case any one not getting actually I wasn't getting and i was getting error then suddenly it came to my mind

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

    Great job and staying on task and keeping it simple.

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

    Great tutorial. Thank so much!

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

    Could you tell, why we don't use hooks when it comes to lazy queries? Is about this array returning from this function instead of object?

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

    NOTE - React Router version has been updated now.- If you use as shown @35:00 then the render wont display. Please use a previous version of React Router like 5.2.0 to see this working correctly

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

      Yes. but instead using the previous version, you can change to as react-router-dom defined when you import it first

  • @ari.joel.m
    @ari.joel.m 3 ปีที่แล้ว

    Thank you for making these videos!

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

    Liking before watching!

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

    It was very helpful. Thank you. ⭐⭐⭐⭐⭐

  • @shooting4star2023
    @shooting4star2023 6 หลายเดือนก่อน

    I am new to GraphQL, but coming in with decent amount of experience on JavaScript and REST API. Maybe I am missing something fundamental, but I have the feeling the Apollo Client is not only making things more cumbersome, but also architecturally wrong. It's very common requiring a real-world app to interact with multiple web API endpoints hosted on different URLs. How can it be done with AC? Furthermore, JavaScript's fetch method is all it takes to issue all types of GQL query HTTP requests with React and each request is independent. The plain GQL query in JSON is very easy to compose and sent in the HTTP POST payload. Using the gql template makes things unnecessary more complicated.

  • @g10-you
    @g10-you ปีที่แล้ว

    Excellent. Thank you so much.

  • @preetianand3282
    @preetianand3282 11 หลายเดือนก่อน

    Why can't I see 'SCHEMA' and 'DOCS' option on right?

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

    Was just coming back to watch your older graphql tuto and I see this :D Is there any chance that you will do some graphql with redux tuto in the futur?

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

    awesome learned a lot thank you.

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

    can you please tell me how to do price range query

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

    Great crash course, thanks

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

    code pls ?!

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

    Thanks bro. You made my day

  • @c.toobitz7566
    @c.toobitz7566 2 ปีที่แล้ว

    Any way to make this work with class components?

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

    hi laith , if possible could you make a aws s3 crash course like you did for lambda?

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

    Thanks for your tutorial brother

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

    Great work, this is really helpful. My question here is how to get the actual error from graphql

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

    where we can find the source code?

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

    great explanation!

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

    won't we need to call use query inside useEffect hook?

  • @НурисламВалеев-з8я
    @НурисламВалеев-з8я 3 ปีที่แล้ว

    Splendid job

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

    I followed the tutorial step by step but my search page is not working properly....When clicking on search the locations don't appear, but when I delete a letter, the query is launched....Can you help ?

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

    Thank you very much! But I have a question: how to prevent the search method from being called every time I type a letter in the text field?

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

      I found a solution: just added a reference to the input field: "const inputRef = useRef();" And then changed state after button click using input field reference: "setName(inputRef.current.value);" I don't know if this is the ideal solution (I'm Java-backender and new in React), but it works for me:
      import {useRef, useState} from "react";
      import {gql, useLazyQuery} from "@apollo/client";
      const GET_CHARACTER_LOCATIONS = gql`
      query GetCharacterLocations($name: String!){
      characters(filter: {name: $name}) {
      results {
      location {
      name
      }
      }
      }
      }
      `;
      export default function Search() {
      const [name, setName] = useState();
      const inputRef = useRef();
      const [getLocations, {loading, data, error, called}] = useLazyQuery(GET_CHARACTER_LOCATIONS, {
      variables: {
      name,
      }
      });
      const handleSearch = () => {
      setName(inputRef.current.value);
      getLocations();
      }
      console.log(loading, data, error, called);
      return (

      Search
      {loading && spinner...}
      {error && something went wrong}
      {data && (
      {data.characters.results.map((character) => {
      return {character.location.name}
      })}
      )}
      );
      }

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

    really helpful video thnks mate

  • @MsAnnieHuang
    @MsAnnieHuang 5 หลายเดือนก่อน

    Hi @Laith Academy, Do you forgot to list the source code for this video?

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

    Good Practice !

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

    good explanations ,keep going.the udemy course is with actual tech stack till now ?do u think to update it soon?

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

    2023 update: Don't use Switch, write your code like this =>
    {" "}
    {" "}
    {" "}

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

      Do you know why do I still get the error: import Routes
      '"react-router-dom"' has no exported member named 'Routes'. Did you mean 'Route'?ts(2724)
      Even if I did this command; npm install react-router-dom@latest ?
      and also imported: import { Route, Routes } from "react-router-dom";

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

      @@rekameszaros1753 Are you coding in JS or TS?

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

    enjoyed the lesson thank u

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

    Hi Laith, may i request WebSocket crash course ? It feel little bit complicated as i learn it, wonder if you can make it easier just like any other crash course! Thank you very much

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

    Where is the link to udemy course?

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

    Great content ,Thank you

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

    In the end you said something like " There is a a great reason not to use custom hooks for useLazyQuery, but you didn't explain it". So, can someone explain that.

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

    Perfect!

  • @mD-mp8bb
    @mD-mp8bb 2 ปีที่แล้ว

    Thanks, make video about graphql type autogen for typescript.

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

    nice man!

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

    THANK YOU SO MUCH!

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

    very good tutorial!!! can you please give the link to code?

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

    Great content as always 👏🏻
    I am confused about caching concept in Apollo Client, can you please clear one doubt.
    API response is stored in cache and from there it is served to the app. But how does the cache stays up to date with latest data from backend? Does it send some network requests in background?
    If so, then isn't that costly because we are sending unnecessary requests and may be the data doesn't change that often at backend but we are continuously sending API requests?
    Can you please clear that how the cache stays up-to-date and how does the Apollo client knows when to fetch data from cache and when from the server?

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

      When your data changes, like in a mutation, you can actually request Apollo to reset the cache. Ben has a good video on this:
      th-cam.com/video/lQ7t20gFR14/w-d-xo.html

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

      @@laithacademy Thank you so much for getting back. My question is a little different.
      Let's suppose no mutation happens from the app. Data is returned from the cache if the cache has the data. But how does Apollo client ensures that there is always updated data in cache?

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

      @@Atif1702 Typically this is handled in one of two ways. Either you sync the cache with the updated data or you run a cron job (every 15min let's say) that makes a request to the backend and puts that data in the cache instead. If you have many users in your application, the requests the cache saves you far exceeds the requests you would do on the job

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

      @@laithacademy Thanks 😊

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

    Awesome.

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

    dude is a god developer!!!

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

    The bouy did the job.!

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

    i folowed exactly what you did, yet, am havung this error "Missing field 'token' while writing result {}", Its really fustrating, Kindly help me out with it

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

    I'd love to see subscriptions sometime soon.

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

    Great work Sir. When should we be expecting a Vue version? Thanks 😊.

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

    Can GraphQL be used with a REST server which is not a GraphQL server ?

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

      Absolutely, GraphQL is typically paired with multiple REST microservices

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

      @@laithacademy So we need to build a Facade like pattern , wherein we have GraphQL server that deals with RESTful calls and sends back the data. Correct me if I am wrong.

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

    Is this relevant for Next 13 too? Or outdated?

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

    If you do a udemy course on graphql I will be the first to buy it! Btw do you already have an udemy channel with some courses by any chance?

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

    I'll buy your graphql course!

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

      coming soon!!

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

      @@laithacademy you better not use Hasura on the backend... hint hint

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

    Thankyou so much!

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

    Thank you so much

  • @ABUTAHER-wg7gz
    @ABUTAHER-wg7gz 2 ปีที่แล้ว

    unexpected apollo client api calling, like- i got a id form react useParam, it should be call frist time only but if change any other state, gql query calling api every time

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

    good one

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

    This kind of reminds me of React Query or RWS in Next Js

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

    thanks

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

    Started like its a tutorial by Traversy Academy because of the intro.

  • @Nico-sb5qs
    @Nico-sb5qs 2 ปีที่แล้ว

    nice

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

    Merci.

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

    Source code?

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

    Apollo be like: " I will bring PHP in every language"

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

    Next how to use apollo cache as replacement for redux

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

    subscription broadcast apollo with react and gql