Hehe... no I didn't :D I actually wrote an article about it using Ruby on Rails pganalyze.com/blog/efficient-graphql-queries-in-ruby-on-rails-and-postgres but the truth is that I don't maintain any sort of production node based GraphQL API, so I haven't been deep into this stuff. My apologies!
Great video! Nice to see a thorough explanation of this issue and a bonus to see another dev down with the core!! (I come from that scene and have been getting into development over the past year, so this is the best of both worlds! Lol)
Hello, Leigh thank you for this tutorial. How do pass user alongside the loader in the context. I am trying to handle authentication and authorization.
Hey Peter! I believe you'd have to load the user within the context function here: github.com/leighhalliday/nextjs-graphql-example/blob/dataloader/pages/api/graphql.js#L112
Hello Leigh i have a ques, if i have a type like this type Order { total qtity createdAt user { id name } client { id name } } this single loader still work?
Coming at some point in the future :D I want to cover the topics I covered in my article here, but do them in Node (article is about Ruby on Rails). pganalyze.com/blog/efficient-graphql-queries-in-ruby-on-rails-and-postgres
Hi leigh thank you so much for the lesson! 😭🙏🏼 I want to ask, if i want to load 100 records in a single request, is it possible to cache them when using dataloader ?
Thanks, Gede! What do you mean cache them? So that on the following API request DataLoader doesn't have to fetch a record it has already loaded? I suppose it is... but you'd have to save it somewhere, right? If you save it in memory, you'd want to make sure that it doesn't bloat too much, if you save it in Redis, you'd be required to do 1 request to Redis then 1 request to Postgres to fetch remaining... so you may find it's just easier to avoid thinking about caching until it becomes an issue.
@@leighhalliday Yes thats the idea, i dont have to re-fetch the data again if i already load it once. Thank you so much for the tip leigh. I'll try your redis suggestion. This tutorial helped me a lot on my final exam 🙏🏼🙏🏼
RUclips is still processing the HD versions... just finished uploading. They publish SD first and then HD when it's ready. Wait like 30 minutes and it should be good.
I love this channel, always practical examples.
Thanks, Mel :) I appreciate it. N+1 in GraphQL can kill your performance like nothing else!
Looks good to work with early 2000's hardcore albums !
Nothing is better for coding!
@@leighhalliday That's right !
You create terrific videos even stuff relative noob can understand.
Thanks, Vincent! That's my goal :D
Good stuff
Hey man, did you ever do the video loading multiple records?
Hehe... no I didn't :D I actually wrote an article about it using Ruby on Rails pganalyze.com/blog/efficient-graphql-queries-in-ruby-on-rails-and-postgres but the truth is that I don't maintain any sort of production node based GraphQL API, so I haven't been deep into this stuff. My apologies!
@@leighhalliday no worries, your content is always relevant, and you always use great examples. looking forward to the next video!
Suppose, I want to display two artist names for each album and for this what should be the query?
Comeback Kid!! Hell yeah!
Wake the silence, wake the dead!
Great video! Nice to see a thorough explanation of this issue and a bonus to see another dev down with the core!! (I come from that scene and have been getting into development over the past year, so this is the best of both worlds! Lol)
Thank you
Glad you enjoyed it Matthew!
Hello, Leigh thank you for this tutorial. How do pass user alongside the loader in the context. I am trying to handle authentication and authorization.
Hey Peter! I believe you'd have to load the user within the context function here: github.com/leighhalliday/nextjs-graphql-example/blob/dataloader/pages/api/graphql.js#L112
Hello Leigh i have a ques, if i have a type like this
type Order {
total
qtity
createdAt
user {
id
name
}
client {
id
name
}
}
this single loader still work?
You would use a User loader and a Client loader
Hey Leigh, could you help me out to solve this issue using nexus for schema definitions?
Hey Aleksej! I'd love to but I honestly am so strapped for time I don't think I can look into this... barely holding on as is.
@@leighhalliday I totally understand. Do you have some useful references?
thanks
You're welcome Freelancer!
in the video its mentioned more advance dataloader usecases?
Coming at some point in the future :D I want to cover the topics I covered in my article here, but do them in Node (article is about Ruby on Rails). pganalyze.com/blog/efficient-graphql-queries-in-ruby-on-rails-and-postgres
Thanks for the insightful video
Where is the link mentioned at 3:19 tho? :)
Haha... I honestly have no idea. Here's one that may help though :) ruclips.net/video/_HOp7hBEjp8/видео.html
Hi leigh thank you so much for the lesson! 😭🙏🏼 I want to ask, if i want to load 100 records in a single request, is it possible to cache them when using dataloader ?
Thanks, Gede! What do you mean cache them? So that on the following API request DataLoader doesn't have to fetch a record it has already loaded? I suppose it is... but you'd have to save it somewhere, right? If you save it in memory, you'd want to make sure that it doesn't bloat too much, if you save it in Redis, you'd be required to do 1 request to Redis then 1 request to Postgres to fetch remaining... so you may find it's just easier to avoid thinking about caching until it becomes an issue.
@@leighhalliday Yes thats the idea, i dont have to re-fetch the data again if i already load it once. Thank you so much for the tip leigh. I'll try your redis suggestion. This tutorial helped me a lot on my final exam 🙏🏼🙏🏼
It's from facebook indeed!
It's a great pattern!
Why video quality is not higher than 360p
RUclips is still processing the HD versions... just finished uploading. They publish SD first and then HD when it's ready. Wait like 30 minutes and it should be good.
Great work Leigh!
Thanks Andrew!
Or just use Hasura ☺️
I've been meaning to try that out! Looks really cool.