Learn Apollo Client's useQuery Hook in Less Than 20 Minutes

  Рет қаралды 9,476

Chris DeSilva

Chris DeSilva

Күн бұрын

Пікірлер: 18
@remccs16
@remccs16 3 жыл бұрын
THANK YOU SO MUCH YOU HAVE NO IDEA HOW LONG I'VE BEEN SEARCHING FOR HOW TO PASS VARIABLES TO QUERIES ❤️
@TheRealGloo
@TheRealGloo 2 жыл бұрын
Hey chris how come the R in rate changed font in the filter function at 9:38 i want that extension if it is one thanks
@ChrisDeSilva
@ChrisDeSilva 2 жыл бұрын
I'm using Victor Mono font and updated my VSCode settings to use italics for certain things. Here's a Stack Overflow thread that should get you pointed in the right direction: stackoverflow.com/questions/41320848/how-do-i-get-visual-studio-code-to-display-italic-fonts-in-formatted-code
@giancarlocabrera7336
@giancarlocabrera7336 2 жыл бұрын
Chris i have a question, what if i want to do my query once the user submits a form, i've been tying to do it but it does not let me do the query inside a function onSubmit
@ChrisDeSilva
@ChrisDeSilva 2 жыл бұрын
Check out the docs to either use the refetch method or useLazyQuery - www.apollographql.com/docs/react/data/queries/#manual-execution-with-uselazyquery
@alexkey9372
@alexkey9372 2 жыл бұрын
Thanks, in my case though it doesn't update/re-render when currency is triggered. It works only when I do this manually. something change in apollo client since this video was released? Is there an extra step to force update?
@ChrisDeSilva
@ChrisDeSilva 2 жыл бұрын
It's tough to say without seeing your code, but as long as you're using useQuery and are passing in the variable it should fetch automatically. There are cases where you can manually fetch with useLazyQuery or refetch as well but that shouldn't necessarily apply here. Here's the docs page which looks to be the same as when I recorded the video: www.apollographql.com/docs/react/data/queries/
@alexkey9372
@alexkey9372 2 жыл бұрын
@@ChrisDeSilva thanks. I figured it out but still not complete solution. It seems that for it to work the fetchPolicy should be cache-and-network. However, this will re-render data meaning that it will re-fetch with new variables but whilst loading the previous data will not be shown (what if i want to load products on an ecommerce site, i can't be showing loading info on every filter or every "load more").
@The3Alexey
@The3Alexey 3 жыл бұрын
How to use in react app hook useQuery from importing file with extension .graphql
@HimanshuSharma-vo3ny
@HimanshuSharma-vo3ny 2 жыл бұрын
Very helpful!👏
@igorskryl5041
@igorskryl5041 3 жыл бұрын
Nice tutorial, Chris, thank you! Can we wait a video about useMutation hook?
@ChrisDeSilva
@ChrisDeSilva 3 жыл бұрын
Thanks! I'll get something put together for the useMutation hook in the next few days and post a video by the end of the week.
@igorskryl5041
@igorskryl5041 3 жыл бұрын
@@ChrisDeSilva got it, thanks!
@ChrisDeSilva
@ChrisDeSilva 3 жыл бұрын
Just posted the mutation video. Hope it's helpful!
@jjeon9850
@jjeon9850 3 жыл бұрын
Hey man, thanks for the video. What would you do if you wanted to create your own variable type as input instead of string? Not finding anything good online about this. Thanks if you can let me know.
@ChrisDeSilva
@ChrisDeSilva 3 жыл бұрын
It's all set up on the API side. In this video, the sandbox we used is only set up to expect a string for currency. If you wanted something more complex then you'd have to build it out on the back end.
@venkatapenumatsa3959
@venkatapenumatsa3959 3 жыл бұрын
Awesome sir. Really useful
@christiandasilva3590
@christiandasilva3590 3 жыл бұрын
Great video! Great name!
Learn Apollo Client's useMutation Hook in Less Than 30 Minutes
29:51
ССЫЛКА НА ИГРУ В КОММЕНТАХ #shorts
0:36
Паша Осадчий
Рет қаралды 8 МЛН
요즘유행 찍는법
0:34
오마이비키 OMV
Рет қаралды 12 МЛН
How to have fun with a child 🤣 Food wrap frame! #shorts
0:21
BadaBOOM!
Рет қаралды 17 МЛН
Why I avoid useEffect For API Calls and use React Query instead
17:45
React Forms with Formik, Yup, and Material UI
17:57
Chris DeSilva
Рет қаралды 9 М.
React With GraphQL (Apollo Client) Crash Course
1:06:28
Laith Academy
Рет қаралды 91 М.
Why Signals Are Better Than React Hooks
16:30
Web Dev Simplified
Рет қаралды 497 М.
Understanding Caching in Apollo Client 3
24:28
Apollo GraphQL
Рет қаралды 17 М.
GraphQL With React Tutorial - Apollo Client
32:51
PedroTech
Рет қаралды 218 М.
Learn useReducer In 20 Minutes
20:12
Web Dev Simplified
Рет қаралды 525 М.
Custom React Hook for Fetching Data (useQuery)
21:25
Nikita Dev
Рет қаралды 8 М.
ССЫЛКА НА ИГРУ В КОММЕНТАХ #shorts
0:36
Паша Осадчий
Рет қаралды 8 МЛН