GraphQL With React Tutorial - Apollo Client

Sdílet
Vložit
  • čas přidán 17. 12. 2020
  • In this video I will teach you guys how to use React as the client for your GraphQL Project. We will be using Apollo Client 3 to handle all the graphql requests to our Apollo server.
    Code: github.com/machadop1407/Graph...
    First Video: • GraphQL Tutorial Begin...
    🌟 Learn Programming Fundamentals on Brilliant: brilliant.sjv.io/PedroTech
    -
    🚀 Learn ReactJS By Building 6 Projects: codedamn.com/learn/reactjs-pr...
    Please leave a comment on what topic you guys want me to cover next!
    -
    📞 Tutoring Session: www.fiverr.com/share/pw8RPY
    💻 PedroTech Discord: / discord
    -
    Social
    ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
    Website: machadopedro.com
    Twitter: / pedrotech_
    Linkedin: / machadop1407
    Instagram: / _pedro.machado_
    Github: github.com/machadop1407
    Email: machadop1407@gmail.com
    Tags:
    - GraphQL
    - Apollo Client
    - Apollo Server
    - ReactJS Tutorial
    - ReactJS and MySQL
    - NodeJS Tutorial
    - API Tutorial
  • Věda a technologie

Komentáře • 175

  • @jimmycarrera5713
    @jimmycarrera5713 Před 2 lety +8

    this video literally saved my life. It's been a while since the last time I played with GraphQL and Apollo, and there are been some serious changes! I've been working for years with other things, and now that I'm applying to a new job, I had to pass a tech test, pretty basic stuffs but damn, I was struggling. Great work Pedro, thanks for this content.

  • @umutacer01
    @umutacer01 Před 3 lety +8

    I haven't seen any video like that which's telling everything in detail and simple. I really appreciated. Thank you!

  • @denissemendoza3862
    @denissemendoza3862 Před 3 lety +10

    Such great content, as usual. You explain at a beginner level without the need of so much jargon! Keep it up!

  • @hectorserrano9314
    @hectorserrano9314 Před 3 lety +8

    Dude, this was super useful, I subscribed to your channel. I appreciate that you'd create a tutorial to help people out even though you're pretty busy as you've mentioned. Thanks man!

    • @PedroTechnologies
      @PedroTechnologies  Před 3 lety +1

      Thank you so much! The positive support I get is pushing me to work as hard as I can to grow this channel! Really appreciate ur comment!

  • @dominiclapitan8466
    @dominiclapitan8466 Před 3 lety +7

    Thank you for this! I'm recently learning how to use the Apollo client and your video is perfect. Great content! Subscribed :D

  • @diegogallardo8281
    @diegogallardo8281 Před 2 lety

    I love you, I was trying so long to render my content to screen without Apollo and finally gave in and this worked

  • @Vijaykumar-uy3gs
    @Vijaykumar-uy3gs Před 3 lety

    Pedro's savage. Loving your work brother. Wow❕

  • @TheMeepPlay
    @TheMeepPlay Před rokem

    Thanks dude with this video you kinda save me about 2/3 hours of documentation reading, dont really pay attention to bad comments this is obviously a beginner tutorial that serves its purpose by far.

  • @soltiscd
    @soltiscd Před 3 lety +4

    Keep pumping out the good content. Exactly what I needed!

    • @PedroTechnologies
      @PedroTechnologies  Před 3 lety

      Thank you! Glad to hear it!

    • @soltiscd
      @soltiscd Před 3 lety

      @@PedroTechnologies I have seen the npm of @apollo/client and Apollo-Client... what is the difference?

  • @mauriciomarin5599
    @mauriciomarin5599 Před 2 lety

    Dude you are the man! Clean and concise

  • @kushalbansal5508
    @kushalbansal5508 Před 2 lety +1

    Thanks Pedro for making this so easy to understand!

  • @peerfunk
    @peerfunk Před 3 lety +2

    thank you for your work, have trying to get this to work for days with text based tutorials, you finally helped me out thanks man! Very clear, easy and straight forward example!

  • @romimaximus
    @romimaximus Před 3 lety +1

    Yeahhh....😎🤘🤘..thankx for sharing Pedro....another awesome video..!!

  • @ib6548
    @ib6548 Před 2 lety +1

    This was super helpful! You made it look easy!

  • @RenatoRaeffrayBarbosa
    @RenatoRaeffrayBarbosa Před 2 lety

    Great introductory, down to earth. Thank you.

  • @tonyhaddad7153
    @tonyhaddad7153 Před 3 lety +2

    one of the best tutorial makers !! keep it up mate

  • @egzbel4400
    @egzbel4400 Před rokem

    This is the recipe. Easy to follow. Thank you man!

  • @andredesantana2188
    @andredesantana2188 Před 3 lety +6

    Very good tutorial for beginners who are trying to understand GraphQL with React. Keep the good work Pedro. It's not easy to do what you are doing and sharing your knowledge for free is a very noble attitude! I subscribed to the channel and hope you can make advanced tutorial as well in the future!

    • @PedroTechnologies
      @PedroTechnologies  Před 3 lety +1

      Thank you so much bro! Really appreciate the support! Your name makes me think your from latin america, are you Brazilian as well? hahaha

    • @andredesantana2188
      @andredesantana2188 Před 3 lety

      @@PedroTechnologies Yes I'm! But I live in Canada!

    • @zurazura309
      @zurazura309 Před rokem

      ​@@andredesantana2188
      Agree,
      but I have one question,
      So, I have to pass test - to get a job and I'm not familiar with that 2 ("GraphQL" and "Apollo Server") so I'm learning now,
      I watched the first video and start 2nd, but... there is "missing" the part to install "React" along with that
      (to make everything work together and connect).
      as I see Folder and file structure first have to install React and then - in that folder install "GraphQL" and "Apollo Server", right?
      Thanks in advance and Respect from Georgia (Country)

  • @josesilva-ej2xt
    @josesilva-ej2xt Před 4 měsíci

    Dude you explained this so well! Thank you.

  • @funnyanimalworld7579
    @funnyanimalworld7579 Před 2 lety

    you are explaining all this really well for me ,thank you.

  • @pcgs_
    @pcgs_ Před 2 lety

    Muito bom o tutorial!!! Não é atoa que todo Pedro é desenrolado!! Valeuu

  • @bhargavpandya9189
    @bhargavpandya9189 Před 2 lety +3

    Great video Pedro! I would love a more in depth GraphQL and Apollo content... I don't mind long videos at all because you explain well :)

    • @PedroTechnologies
      @PedroTechnologies  Před 2 lety +1

      Im preparing a GQL series that im releasing next week :) it will go a lot more in depth

    • @bhargavpandya9189
      @bhargavpandya9189 Před 2 lety

      @@PedroTechnologies Thanks brother. There isn’t much content on GQL and Apollo out there. I really believe that this channel has great potential. Keep going and you will surely see growth!

  • @umairzafar5205
    @umairzafar5205 Před 2 lety

    Loved it man !!!

  • @swet_1997
    @swet_1997 Před 2 lety

    Thx bro, you are explaining everything like you should. Liked and Subscribed :)

  • @EdgarVicent
    @EdgarVicent Před 3 lety +2

    Excelent video. I watched at 1.5X and is priceless. Thanks!

  • @favourbawa5520
    @favourbawa5520 Před 3 lety +1

    This was amazing, thank you very much!

  • @osyopans
    @osyopans Před 3 lety +1

    Legal Pedro. Espero que tenha muito sucesso com o canal.

  • @riantritiyanuar9237
    @riantritiyanuar9237 Před 2 lety

    Bro, you helped me a lot! Thank You!

  • @ahmedelgaidi
    @ahmedelgaidi Před rokem

    Thank you, man
    Very Helpful

  • @abdullahmoamen9227
    @abdullahmoamen9227 Před 3 lety

    great video
    thanks pedro

  • @BobbyBundlez
    @BobbyBundlez Před 3 lety +1

    so frickin good. great starter vid

  • @sai_charan
    @sai_charan Před 3 lety +1

    Thank you, Pedro!

  • @valentinagomez9415
    @valentinagomez9415 Před 2 lety

    thanks for this video! really, helps me a lot

  • @moha_linus
    @moha_linus Před 3 lety +1

    u made it look so easy bro thank you very much

  • @berakoc8556
    @berakoc8556 Před 10 měsíci +1

    I think using a normal variable instead of state in the component for transforming query data is a better approach. More state = more things to think about.

  • @esotericrhythms9696
    @esotericrhythms9696 Před 2 lety

    This is very helpful :) Thanks.

  • @EduardoDiniz4
    @EduardoDiniz4 Před rokem

    Great video!

  • @alexxmde
    @alexxmde Před 3 lety +7

    The tutorial to rule them all!

  • @mohanr6487
    @mohanr6487 Před 3 lety

    Great video, callback function for createUser? To make sure new user got added successfully or not.

  • @mwnkt
    @mwnkt Před 3 lety +1

    I love you videos , please keep making more

  • @johnreyasong895
    @johnreyasong895 Před 3 lety

    Thank you for this Sir!

  • @mwaqas649
    @mwaqas649 Před rokem

    Really appreciated ❤

  • @kinoshan591
    @kinoshan591 Před 3 lety +1

    Thank you for the tutorial ❤️

  • @jeremiahnsiahakuoko2042

    Very helpful tutorial!

  • @emeken
    @emeken Před 3 lety +1

    This is awesome!

  • @tonymore3904
    @tonymore3904 Před 3 lety +1

    you are amazing pedro dom.

  • @wladmyrmachado2333
    @wladmyrmachado2333 Před 3 lety +1

    Awesome!

  • @novudusomasekhar702
    @novudusomasekhar702 Před rokem

    Thanks a lot for this video, i have a question which is after user is created, how to call getAllUsers query to get latest user list?

  • @MasharipovSaidbek
    @MasharipovSaidbek Před rokem +1

    nice!

  • @zubinmukherjee1020
    @zubinmukherjee1020 Před 3 lety +1

    great work ! Thanks

  • @keithcarrillo8238
    @keithcarrillo8238 Před 3 lety +1

    Hey thanks for the video Pedro. I was wondering does your backend have to have GraphQL in order for your front end to use GraphQL as well. Or can my backend just simply return json data and my frontend can still use GraphQL?

    • @PedroTechnologies
      @PedroTechnologies  Před 3 lety +1

      Interesting question! I believe it would be possible however most frontend graphql libraries require you to have 1 single endpoint (the /graphql) endpoint. Hence I don't know how that would work!

    • @keithcarrillo8238
      @keithcarrillo8238 Před 3 lety

      @@PedroTechnologies Oh ok Thanks Pedro!

  • @silvesterwali6565
    @silvesterwali6565 Před 3 lety +1

    this is amazing bro

  • @jikol9631
    @jikol9631 Před 2 lety

    7:01 - This is where I lost it, good job

  • @IamSH1VA
    @IamSH1VA Před 3 lety +1

    Nice tutorial 👍
    Thanks 🙏

  • @faiqhacili7504
    @faiqhacili7504 Před 2 lety

    You are great thank you!

  • @kevinavignon4335
    @kevinavignon4335 Před 2 lety

    What are the VS Code extensions that you are using?

  • @Shellflower1234
    @Shellflower1234 Před 3 lety +1

    Wowww

  • @yigitruzgaruzun7289
    @yigitruzgaruzun7289 Před 3 lety +1

    Thanks. Please continue to Apollo

  • @dariashaulko4867
    @dariashaulko4867 Před 2 lety +1

    How to use Graphql query with class components in React?

  • @Viniciusgnux
    @Viniciusgnux Před 2 lety

    kkkk excelente video bro.

  • @jeremyflowers8908
    @jeremyflowers8908 Před rokem

    26:48 You could define input type to avoid duplication

  • @RenatoRaeffrayBarbosa
    @RenatoRaeffrayBarbosa Před 2 lety +1

    Thanks!

  • @magicfibre
    @magicfibre Před 5 měsíci

    28:23 Does it though? This looks like array destructuring, which doesn't care about names, only positions. While it's probably good practice to name them the same to avoid confusion, it doesn't have to be the same.
    Apart from that little nitpick, thanks for making this video! It's a very nice introduction to the library!

  • @okeyshourovroy2769
    @okeyshourovroy2769 Před 2 lety

    While using apollo client in nextjs the cookie is not sending to the backend. Even after using cors in backend with origin and credentials true.
    And in apollo client credentials true.
    Still cookie not sending to the backend with request.
    Can you please help out with a tutorial?

  • @arwysyah2400
    @arwysyah2400 Před 3 lety +1

    Hei bro , nice ,,,, you explain about that super clear

  • @sayyedirfan6766
    @sayyedirfan6766 Před rokem

    Nice

  • @jackdo6594
    @jackdo6594 Před rokem

    Nice content

  • @vaibhavmavani1071
    @vaibhavmavani1071 Před 3 lety +1

    Really useful video

  • @champong00
    @champong00 Před 3 lety +2

    They called it Backtick ``, It is use when you want to write multiple line.

  • @anchalsrivastava9763
    @anchalsrivastava9763 Před 3 lety +1

    Thank you :)

  • @blender_wiki
    @blender_wiki Před 6 měsíci

    Great video, very competent tutorial, however Apollo is good for beginners or for a small project, in productions is better use a solution like Relay.

  • @jasonhackson2805
    @jasonhackson2805 Před 2 lety

    please can you do a tutorial on how to upload single and multiple files using react graphql apollo-server-express. will really be appreciate. doesn't have to be fancy.

  • @EnjoyClassicalMusic
    @EnjoyClassicalMusic Před 2 lety +1

    I really love the colorful icon of your folder in project file tree. Could you tell me which plugin can do it in VSCode? thanks^^

  • @Believer09_29
    @Believer09_29 Před 3 lety

    Well explained, thanks for this amazing video. 👌👌

  • @jmysabbagth8151
    @jmysabbagth8151 Před 3 lety +1

    Great tutorial

  • @OcasoND
    @OcasoND Před rokem

    Thanks

  • @INfoUpgraders
    @INfoUpgraders Před 3 lety +1

    Very helpful

  • @05forn
    @05forn Před 3 lety +1

    Hey pedro, for someone who is beginning their self taught journey could you please provide a roadmap and some resources. Love your videos bro

    • @PedroTechnologies
      @PedroTechnologies  Před 3 lety

      Thank you! I've been wanting to make a video on a roadmap for a while now cause I remember when I started this confused the hell out of me hahaha Should make one soon!

    • @05forn
      @05forn Před 3 lety

      @@PedroTechnologies thanks!

  • @pedromanuelcamargomendez6520

    Gracias. buen aporte.

  • @usmanmughal5916
    @usmanmughal5916 Před 3 lety

    how to use context with it?

  • @selfather
    @selfather Před 2 lety

    good tutorial

  • @AmanVerma-ci3kg
    @AmanVerma-ci3kg Před 2 lety

    Unable to pass mongodb _id to mutation , It's not supporting 32 signed bit

  • @yogeshsharma8966
    @yogeshsharma8966 Před 3 lety

    Can you please share your json data file, or api

  • @justinsengweb-per70
    @justinsengweb-per70 Před 8 měsíci

    where edit do you have brother?

  • @comod
    @comod Před 11 měsíci

    19:54 this is why you should use typescript

  • @michaeltrew8102
    @michaeltrew8102 Před 3 lety +1

    What happened to last name in the API? was it just not hooked up?

    • @PedroTechnologies
      @PedroTechnologies  Před 3 lety +1

      It is still there! With graphql i can specify what I want to see, so I just forgot to add lastName as one of the fields in the request, but in the json it is still there!

  • @rubberclay
    @rubberclay Před 2 lety

    How can I solve CORS problem in 17:00 ?

  • @little01giant68
    @little01giant68 Před rokem

    how to get one user (use to id)

  • @nanonkay5669
    @nanonkay5669 Před 2 lety +1

    The set up looks more complicated than usual. I thought the useQuery hook already dealt with error handling and all that.

  • @mehmettemell
    @mehmettemell Před 3 lety +1

    good content

  • @Pilosofia
    @Pilosofia Před 3 lety +1

    We need video from catching and state management in apollo client

  • @dylanarveson9594
    @dylanarveson9594 Před 2 lety

    * notices port number *
    Nice.

  • @candycane55
    @candycane55 Před 3 lety +1

    Just a beginner question. Why do we actually need to something like apollo? We can call the APIs using fetch or axios as well right?
    Sorry if that's a stupid question

    • @PedroTechnologies
      @PedroTechnologies  Před 3 lety

      It's not a stupid question hahaha I had the same doubt back when I started. You can use axios/fetch but its significantly harder/more annoying lmao. Cause the way you structure a gql request is very different from a way you structure a normal http request. I defo recommend a gql frontend library like apollo, most big companies using gql uses it :)

  • @blizzardking1320
    @blizzardking1320 Před 2 lety

    No merch!?!??

  • @HoNow222
    @HoNow222 Před 3 lety +1

    Please if you edit your code make sure to say it in the video!!

  • @KevinEontrainer381
    @KevinEontrainer381 Před 2 lety

    The only thing I remember from this is the port number

  • @oscararmenta3537
    @oscararmenta3537 Před 2 lety +2

    I already try everything, but for some reason not data is displayed: When I try to make the client reach the graphQL server it appears bad request, and the data as undefined tree times.

    • @PedroTechnologies
      @PedroTechnologies  Před 2 lety +1

      Can you post the error or gql response here?

    • @apimpnamedflipflap
      @apimpnamedflipflap Před 2 lety

      ​@@PedroTechnologies I had the same issue when i was trying to do mutations. However my code was a bit different from PedroTechs and i was trying to query towards mongoDB.
      Anyhow in case it helps anyone, this was my solution:
      I put the query variables in an object ->........ createPost(name: {variables}) ........... and now it works, like so:
      export const CREATE_POST = gql`
      mutation CreatePost($name: String!, $title: String!, $description: String!) {
      createPost(name: {$name, title: $title, description: $description}) {
      id
      name
      title
      description
      }
      }
      `;

    • @oscararmenta3537
      @oscararmenta3537 Před 2 lety +1

      @@PedroTechnologies Oh I already solve it, it was just a typo mistake. Thank you so much for your comment is really good to know a CZcamsr that cares and listens to his suscribers you're awesome!!!

  • @victoriabella9682
    @victoriabella9682 Před 2 lety

    Clair

  • @youssefel-shabasy833
    @youssefel-shabasy833 Před 3 lety +1

    how old are you ?

  • @babbego
    @babbego Před 2 lety

    yeah map on an object? yeah...