React With GraphQL (Apollo Client) Crash Course

Поділитися
Вставка
  • Опубліковано 9 лис 2024

КОМЕНТАРІ • 126

  • @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 9 місяців тому

    Best React With GraphQL crash course in UA-cam❤

  • @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

  • @awara6984
    @awara6984 3 роки тому +1

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

  • @bagusamrullah4371
    @bagusamrullah4371 3 роки тому +8

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

  • @priyeshjammula854
    @priyeshjammula854 2 роки тому

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

  • @keshavsharma-vx8ni
    @keshavsharma-vx8ni 2 роки тому

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

  • @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

  • @rounakbhattacherje3426
    @rounakbhattacherje3426 Рік тому

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

  • @codingcafe8360
    @codingcafe8360 9 місяців тому

    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!

  • @dananjayachathuranga7113
    @dananjayachathuranga7113 Рік тому

    this is the best video for learn graphql client

  • @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

  • @SaurabhNative
    @SaurabhNative 2 роки тому +2

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

  • @bayasahamed1815
    @bayasahamed1815 10 місяців тому

    It's simple and informative. Thanks!!

  • @zillboy
    @zillboy 2 роки тому

    Really amazing crash crouse, thanks Laith Academy.

  • @frontendonly
    @frontendonly 2 роки тому

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

  • @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.

  • @AlvesCleiton
    @AlvesCleiton Рік тому

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

  • @redm1n272
    @redm1n272 2 роки тому

    This video really helped me. Thank you very much!

  • @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.

  • @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 :)

  • @mohamedramsey8352
    @mohamedramsey8352 Рік тому

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

  • @bamii_a
    @bamii_a 3 роки тому

    The crash course I didn't know I needed 💯

  • @gmjitendra
    @gmjitendra 11 місяців тому

    Excellent. Thank you so much.

  • @0xAndy
    @0xAndy 2 роки тому

    Fantastic. Just what I needed.

  • @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?

  • @judoScott
    @judoScott 2 роки тому +1

    Great tutorial. Thank so much!

  • @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?

  • @rileynobles7146
    @rileynobles7146 2 роки тому

    Great job and staying on task and keeping it simple.

  • @dzhaniivanov5837
    @dzhaniivanov5837 Рік тому

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

  • @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?

  • @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

  • @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?

  • @shooting4star2023
    @shooting4star2023 4 місяці тому

    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.

  • @iUmerFarooq
    @iUmerFarooq 2 роки тому

    You're doing great bro 👊

  • @mD-mp8bb
    @mD-mp8bb 2 роки тому

    Thanks, make video about graphql type autogen for typescript.

  • @takayumaja9438
    @takayumaja9438 2 роки тому

    Thanks for your tutorial brother

  • @orubenlopes
    @orubenlopes 3 роки тому

    Liking before watching!

  • @ai_coding
    @ai_coding Рік тому

    awesome learned a lot thank you.

  • @ari.joel.m
    @ari.joel.m 3 роки тому

    Thank you for making these videos!

  • @siavoshoon
    @siavoshoon 2 роки тому

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

  • @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:
      ua-cam.com/video/lQ7t20gFR14/v-deo.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 😊

  • @tsmmith9252
    @tsmmith9252 3 роки тому +1

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

  • @MrAhvids
    @MrAhvids 3 роки тому

    I'd love to see subscriptions sometime soon.

  • @sunnymishra6500
    @sunnymishra6500 2 роки тому

    really helpful video thnks mate

  • @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}
      })}
      )}
      );
      }

  • @juhandvan
    @juhandvan Рік тому

    Good Practice !

  • @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

  • @sourabhvaishnav8235
    @sourabhvaishnav8235 Рік тому

    The bouy did the job.!

  • @yaldakarimi3772
    @yaldakarimi3772 3 роки тому

    Great crash course, thanks

  • @nwobodogeorge5370
    @nwobodogeorge5370 2 роки тому

    Thanks bro. You made my day

  • @delias1yt
    @delias1yt 8 місяців тому

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

  • @andrews13
    @andrews13 Рік тому

    Perfect!

  • @NeoCoding
    @NeoCoding 2 роки тому

    enjoyed the lesson thank u

  • @igorr4682
    @igorr4682 2 роки тому

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

  • @НурисламВалеев-з8я

    Splendid job

  • @ndanzzid566
    @ndanzzid566 2 роки тому

    great explanation!

  • @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?

  • @moazamdev
    @moazamdev Рік тому

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

  • @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.

  • @aqibfayyaz1619
    @aqibfayyaz1619 2 роки тому

    Awesome.

  • @shanglee643
    @shanglee643 3 роки тому

    dude is a god developer!!!

  • @lobsanggyatso6280
    @lobsanggyatso6280 2 роки тому

    can you please tell me how to do price range query

  • @MsAnnieHuang
    @MsAnnieHuang 3 місяці тому

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

  • @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

  • @stephl9961
    @stephl9961 2 роки тому

    THANK YOU SO MUCH!

  • @akshaynarwadkar5264
    @akshaynarwadkar5264 20 днів тому

    thanks

  • @rashedulalam7754
    @rashedulalam7754 3 роки тому

    Great content ,Thank you

  • @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

  • @rafael7425
    @rafael7425 2 роки тому

    nice man!

  • @sanusivictorolajuwon514
    @sanusivictorolajuwon514 3 роки тому

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

  • @yusufabdulla6018
    @yusufabdulla6018 2 роки тому

    Thank you so much

  • @milon27
    @milon27 3 роки тому

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

  • @dennisgonzales9521
    @dennisgonzales9521 3 роки тому

    Thankyou so much!

  • @StevanMedic
    @StevanMedic 2 роки тому

    Great to listen at 1.5x speed

  • @preetianand3282
    @preetianand3282 9 місяців тому

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

  • @kritikadhuria8542
    @kritikadhuria8542 3 роки тому

    Where is the link to udemy course?

  • @c.toobitz7566
    @c.toobitz7566 2 роки тому

    Any way to make this work with class components?

  • @Nico-sb5qs
    @Nico-sb5qs 2 роки тому

    nice

  • @physcript2436
    @physcript2436 3 роки тому

    subscription broadcast apollo with react and gql

  • @physcript2436
    @physcript2436 3 роки тому

    good one

  • @jordannlegal6161
    @jordannlegal6161 Рік тому

    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 ?

  • @_rachid
    @_rachid 3 роки тому

    Merci.

  • @ridl27
    @ridl27 3 роки тому +4

    code pls ?!

  • @johndavemanuel9603
    @johndavemanuel9603 2 роки тому +1

    where we can find the source code?

  • @shoibalhossain824
    @shoibalhossain824 2 роки тому

    please wrap it all.

  • @taunado
    @taunado Рік тому

    Is this relevant for Next 13 too? Or outdated?

  • @rajathvp
    @rajathvp 2 роки тому +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 2 роки тому +2

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

  • @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.

  • @reilwaystation9511
    @reilwaystation9511 2 роки тому

    Next how to use apollo cache as replacement for redux

  • @zaurmahmudov1438
    @zaurmahmudov1438 3 роки тому +1

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

  • @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

  • @ABUTAHER-wg7gz
    @ABUTAHER-wg7gz Рік тому

    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