THANK YOU SO MUCH YOU HAVE NO IDEA HOW LONG I'VE BEEN SEARCHING FOR HOW TO PASS VARIABLES TO QUERIES ❤️
@TheRealGloo2 жыл бұрын
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
@ChrisDeSilva2 жыл бұрын
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
@giancarlocabrera73362 жыл бұрын
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
@ChrisDeSilva2 жыл бұрын
Check out the docs to either use the refetch method or useLazyQuery - www.apollographql.com/docs/react/data/queries/#manual-execution-with-uselazyquery
@alexkey93722 жыл бұрын
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?
@ChrisDeSilva2 жыл бұрын
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/
@alexkey93722 жыл бұрын
@@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").
@The3Alexey3 жыл бұрын
How to use in react app hook useQuery from importing file with extension .graphql
@HimanshuSharma-vo3ny2 жыл бұрын
Very helpful!👏
@igorskryl50413 жыл бұрын
Nice tutorial, Chris, thank you! Can we wait a video about useMutation hook?
@ChrisDeSilva3 жыл бұрын
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.
@igorskryl50413 жыл бұрын
@@ChrisDeSilva got it, thanks!
@ChrisDeSilva3 жыл бұрын
Just posted the mutation video. Hope it's helpful!
@jjeon98503 жыл бұрын
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.
@ChrisDeSilva3 жыл бұрын
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.