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

preview_player
Показать описание


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.

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
Рекомендации по теме
Комментарии
Автор

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.

dryujin
Автор

Thank you! This helps me alot! Please post pagination or search filtering maybe?

mulaicoding
Автор

Hey, a'm using useQuery but every render of component useQuery calling api backend how can i protect it

ABUTAHER-wggz
Автор

왜 이 영상이 나한테 추천됐는지는 모르겠지만 유튜브 알고리즘의 간택을 축하합니다

pocqkiu
Автор

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

lolmeow