@@leighhalliday Estoy muy agradecido contigo Leigh, me han ayudado bastante tus videos :D, aunque no entienda el inglés, tus videos son bastante entendibles, reitero, eres el mejor!
You're welcome José, glad it was able to help! Apollo has changed their pagination approach since this video came out I believe, so just make sure to check with the docs for the latest content.
Great video! Does Apollo have other methods to facilitate adding individual data to this set? Similar to how `fetchMore` covers the common case of loading more data and adds this data to the existing list so you don't have to write a wrapper to manage this state around it. Is there other method to cover the case of creating new object? Imagine you had a form that allowed you to create repos. You would also want this newly created repo to show up in that list if the request was successful.
Hey Matt! Thank you :) I think there are 2 opportunities for updating cache... first is after a mutation, and Apollo provides some examples for that here: www.apollographql.com/docs/react/data/mutations/#updating-the-cache-after-a-mutation but you could also update the cache outside of a mutation sort of whenever you want via the apollo client's cache: www.apollographql.com/docs/react/caching/cache-interaction/
Awesome as always, Leigh :-) What are some recommended resources to ramp up quickly on graphql && apollo && react? Obviously watching all of your videos first since it feels so natural to see you writing code as you speak and it makes it so easy to grab the concepts :-) Looking forward to your next video :-)
Thanks Rakib, you're awesome too! I think after a couple tutorials the only thing that helps is just to jump in and try building something. The only reason I can make a video like this is because it isn't my first time trying out these concepts... Just have to dive in, suffer a bit, but it's the only way.
Hi leigh, i have a question. I'd i build the graphql server using apollo and also using knex like your n+1 video, is it possible to implement cursor based pagination on the server side or is does it only allowed to use this method on the client ? Thank you so much ;))
Hey! You can definitely do cursor based pagination server side as well... basically the cursor can be as simple as a Base64 encoded ID... so you Base64 decode it, and then say `select * from table where id > ${id} limit 10`... and that's basically it in simple terms.
Hello Leigh. Really appreciate your work! I noticed that updateQuery function would soon be depreciated. Apollo 3 uses merge functions to update cache. Could you make a similar video, but using maybe custom merge functions?
Im using TS and I keep getting "No overload matches this call." on the updateQuery function. How do I go about this? My only fix is // @ts-ignore` but I want something more elegant
@10:55 - you haven't mutated edges, you've created a new array in memory and pointed the repositories.edges variable at it. I believe that is a safe, immutable operation. What does immer introduce that isn't covered here? I've not used it.
Immer just makes immutability easier by allowing you as the developer to just mutate the data, and it'll make those necessary changes but immutably. Here's a full video on Immer if interested: th-cam.com/video/BcvezP2Av_4/w-d-xo.html
Hey Ruman! Def possible... you'd have to pass the "cursor" as a query param to the new page, and then use that in getServerSideProps when making your SSR query.
Thank you! It helped me make sense of this GraphQL API I'm working with.
Ws working with flutter_graphql and these concepts translated well! Thank you so much for your help!
You video helped me a lot. Thank you Leigh.
Thanks for this video! This helped me solve something at work thats been bugging me for a week.
Nice! Glad you figured out the issue!!
Thank you for your clear and concise explanation, I really appreciate it!
Your lessons are very valuable. We thank you.
Thank you very much :)
Gracias, Leigh Halliday, eres el mejor!!
Haha thanks, Christian! No, tu eres lo mejor!
@@leighhalliday Estoy muy agradecido contigo Leigh, me han ayudado bastante tus videos :D, aunque no entienda el inglés, tus videos son bastante entendibles, reitero, eres el mejor!
Tanks alot very clear and helpful❤
Thank you veeeeeery much Sir! it worked for me.
Nice! Glad it helped!
Awesome video 👍 you could even add a filter on the query to sort the repos alphabetically with a separate sort button.
Thanks Digital TB! For sure! I just didn't want to complicate things by combining different concepts :)
Right, just getting into graphql takes a little learning.
it has helped me, thanks for sharing.
You're welcome José, glad it was able to help! Apollo has changed their pagination approach since this video came out I believe, so just make sure to check with the docs for the latest content.
Really good
This is really helpful. Thank you very much!
Brilliant
Thank you!
Thanks a lot You saved my time.
Happy to help :)
Thank you so much, Leigh.
Thanks apurv, glad you enjoyed the video!
Why don’t you make more videos on such unexplored topics and be a mentor on Udemy?
I may try to do a course some day... Not sure on what topic yet though :)
Thank you
Glad it helped!
You're a life saver. Thanks a lot for this.
Glad it helped, Farouq! Thanks for saying hi :)
Great one. really life saver
Woohoo! Glad the video helped :)
Well thank you! You saved me some valuable time !
Excellent! You're welcome :)
ur the best. keep doing this kinda videos. 😊
Thanks, Ali!! I appreciate it :)
Great video!
Does Apollo have other methods to facilitate adding individual data to this set? Similar to how `fetchMore` covers the common case of loading more data and adds this data to the existing list so you don't have to write a wrapper to manage this state around it. Is there other method to cover the case of creating new object? Imagine you had a form that allowed you to create repos. You would also want this newly created repo to show up in that list if the request was successful.
Hey Matt! Thank you :)
I think there are 2 opportunities for updating cache... first is after a mutation, and Apollo provides some examples for that here: www.apollographql.com/docs/react/data/mutations/#updating-the-cache-after-a-mutation but you could also update the cache outside of a mutation sort of whenever you want via the apollo client's cache: www.apollographql.com/docs/react/caching/cache-interaction/
Awesome as always, Leigh :-)
What are some recommended resources to ramp up quickly on graphql && apollo && react?
Obviously watching all of your videos first since it feels so natural to see you writing code as you speak and it makes it so easy to grab the concepts :-)
Looking forward to your next video :-)
Thanks Rakib, you're awesome too! I think after a couple tutorials the only thing that helps is just to jump in and try building something. The only reason I can make a video like this is because it isn't my first time trying out these concepts... Just have to dive in, suffer a bit, but it's the only way.
Hi leigh, i have a question. I'd i build the graphql server using apollo and also using knex like your n+1 video, is it possible to implement cursor based pagination on the server side or is does it only allowed to use this method on the client ? Thank you so much ;))
Hey! You can definitely do cursor based pagination server side as well... basically the cursor can be as simple as a Base64 encoded ID... so you Base64 decode it, and then say `select * from table where id > ${id} limit 10`... and that's basically it in simple terms.
Hello Leigh. Really appreciate your work! I noticed that updateQuery function would soon be depreciated. Apollo 3 uses merge functions to update cache. Could you make a similar video, but using maybe custom merge functions?
Hey Christian! Yea, I noticed that recently too... it's something I'd like to cover but I have to learn it myself first :D
@@leighhalliday Alright. Thanks.
Is it possible to change the length of the next data? For example get 10 first and then get the rest? Great Video!!
Yup! I think you'd have to pass that up as a field to your GraphQL query.
You are so awesome!
thank you man, you saved my ass :)
GG
Im using TS and I keep getting "No overload matches this call." on the updateQuery function. How do I go about this? My only fix is // @ts-ignore` but I want something more elegant
@10:55 - you haven't mutated edges, you've created a new array in memory and pointed the repositories.edges variable at it. I believe that is a safe, immutable operation. What does immer introduce that isn't covered here? I've not used it.
Immer just makes immutability easier by allowing you as the developer to just mutate the data, and it'll make those necessary changes but immutably. Here's a full video on Immer if interested: th-cam.com/video/BcvezP2Av_4/w-d-xo.html
Do you have a tutorial for server implementation? On how this cursor based implemented
Hey John! Sorry, I don't. The truth is that most of the backend work I've done with GraphQL has been in Ruby on Rails.
Is there anyway to do it in next.js `getServerSideProps` or in `getStaticProps` ? I cannot seem to find resource on this
Hey Ruman! Def possible... you'd have to pass the "cursor" as a query param to the new page, and then use that in getServerSideProps when making your SSR query.
how about optmistic rendering next.
I don't know anything about this :D Something to learn!! I'll write it down on my list.
ok, how to create a pagination like ◀ 1 2 3 4 5 ▶ ?
this is not working, updateQuery method has been deprecated in the latest version of Apollo
Shoot! Better to refer to the documentation then.
GG