Apollo Client Queries with React and Apollo Server (useQuery, useLazyQuery)

  Рет қаралды 4,263

Cooper Codes

Cooper Codes

Күн бұрын

Enjoying my videos? Sign up for more content here: www.coopercodes.com/
Interested in a 1:1 Mentorship with me? Jumpstart your career at www.rebrand.ly/coopercodesmen...
Link to backend API here: github.com/coopercodes/dogAPI
In this video I go over how to use useQuery and useLazyQuery in your React projects when communicating with Apollo Server. We start by initializng a backend apollo server for us to use. We then initalize the Apollo Client in our React project to communicate locally. We then go into the main query logic behind useQuery and useLazyQuery, by showing practical examples using variables and also text input from the user.
Buying stuff through my Amazon link supports the channel! amzn.to/3hK5gd0
Business inquiry? Email thecoopercodes@gmail.com
apollo client 3
0:00 Intro
1:05 Setup Apollo Server backend
2:40 Setup React project
3:45 Initialize Apollo Client
6:56 Create first query with useQuery (getAllDogs)
12:00 Explaining onCompleted
15:48 Creating query with variables (getDog)
21:12 Set up React useState for text input
22:20 Change useQuery to useLazyQuery
26:17 Outro

Пікірлер: 9
@dryujin1004
@dryujin1004 Жыл бұрын
thank you so much!! it works!! i was trying to connect GraphQL api to get data. it took about whole day.. as soon as i met your video, i finially made it. only took 20 min. thank you. and i will looking forward meet your video again.
@gabrieldsfaria
@gabrieldsfaria 7 ай бұрын
Thanks! Very helpful!
@mulaicoding1805
@mulaicoding1805 Жыл бұрын
Thank you! This helps me alot! Please post pagination or search filtering maybe?
@CooperCodes
@CooperCodes Жыл бұрын
Will do a video on these topics soon! Thank you for the comment
@ABUTAHER-wg7gz
@ABUTAHER-wg7gz Жыл бұрын
Hey, a'm using useQuery but every render of component useQuery calling api backend how can i protect it
@user-po8cq1ki7u
@user-po8cq1ki7u Жыл бұрын
왜 이 영상이 나한테 추천됐는지는 모르겠지만 유튜브 알고리즘의 간택을 축하합니다
@aliabbassohag
@aliabbassohag Жыл бұрын
?
@lolmeow
@lolmeow Жыл бұрын
please rename your playlist, this is not apollo client fundamentals. this is just another, one of the countless, generic howto videos which leave you with a to-do list without understanding so to note, i am not trying to discourage you or anything. here is an example, this is however just an overview: kzbin.info/www/bejne/r4jdfH2GrMSJsK8
@CooperCodes
@CooperCodes Жыл бұрын
Apollo client is the client for Apollo Server, what you have referenced is a GraphQL Client video. This video is very much explaining the fundamentals behind Apollo Client, while assuming you have some understanding of what a GraphQL Client is. Thanks, but if you need a better understanding of GraphQL as opposed to Apollo itself you can watch those videos no problem.
Apollo Server GraphQL Resolvers for Beginners
20:43
Cooper Codes
Рет қаралды 4,2 М.
Жайдарман | Туған күн 2024 | Алматы
2:22:55
Jaidarman OFFICIAL / JCI
Рет қаралды 1,1 МЛН
A pack of chips with a surprise 🤣😍❤️ #demariki
00:14
Demariki
Рет қаралды 54 МЛН
Deck.gl Bus Routes Visualization
0:43
WebGL 3D
Рет қаралды 1,6 М.
GraphQL API and Apollo Intro - React Tutorial 62
15:31
Caleb Curry
Рет қаралды 4,3 М.
React Apollo State Management Best Practices
7:33
Ben Awad
Рет қаралды 51 М.
Google Identity Services Login with React (2023 React Google Login)
19:50
Все о GraphQL за 30 минут
35:26
Веб-разработка - DevMagazine
Рет қаралды 63 М.
GraphQL in React.js with React Query & OneGraph
11:00
Zaiste Programming
Рет қаралды 6 М.
How to connect pgAdmin with remote supabase [1080p]
6:43
Kamil the Supabase enjoyer
Рет қаралды 658
APPLE совершила РЕВОЛЮЦИЮ!
0:39
ÉЖИ АКСЁНОВ
Рет қаралды 4,2 МЛН
Secret Wireless charger 😱 #shorts
0:28
Mr DegrEE
Рет қаралды 2 МЛН
Asus  VivoBook Винда за 8 часов!
1:00
Sergey Delaisy
Рет қаралды 1,1 МЛН
1$ vs 500$ ВИРТУАЛЬНАЯ РЕАЛЬНОСТЬ !
23:20
GoldenBurst
Рет қаралды 1,2 МЛН
Ждёшь обновление IOS 18? #ios #ios18 #айоэс #apple #iphone #айфон
0:57