Рет қаралды 4,263
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