Hacker GitHub

← All repos

graphql/dataloader

View on GitHub ↗ ★ 13,391 JavaScript

DataLoader is a generic utility to be used as part of your application's data fetching layer to provide a consistent API over various backends and reduce requests to those backends via batching and caching.

37 mentions on Hacker News by 37 people: 1 story, 36 comments · first 2015-09-14 · latest 2026-02-19

Mentions per year 37 mentions · busiest year 2017 (9)
20082026
  1. …because the cache is empty. One of the solutions around this problem was Facebook's Dataloader ( https://github.com/graphql/dataloader ), which tries to intercept the request pipeline, batch the requests together and coalesce many requests…
  2. …What are the status quo solutions to the problems stated above? N+1 I just remember the dataloader https://github.com/graphql/dataloader Is it still used? What about the other things? I remember that Stitching and E2E type safety, for…
    comment by rwieruch · 2025-04-16 · in JSX over the Wire
  3. …some of the mechanics within. Like when to appropriately leverage DataLoader[3], for instance. [3]: https://github.com/graphql/dataloader
  4. …so that later in the graph of calls you don’t need to fetch already loaded data. Here’s one impl: https://github.com/graphql/dataloader
  5. The most common practice is to turn N+1 into 1+1 using dataloaders ( https://github.com/graphql/dataloader for JS, there are equivalents for most implementations). The N resolvers invoke a single batched loader which receives a list of…
    comment by ptramo · 2023-06-18 · in Migrating Netflix to GraphQL safely
  6. Dataloader ( https://github.com/graphql/dataloader ) eliminates many n+1 issues. Basically, entity requests are queued up during evaluation of the query and then you can batch them up for fulfillment. It’s a great addition to other…
    comment by 727374 · 2023-06-18 · in Migrating Netflix to GraphQL safely
  7. Also, have a look at Facebook's Dataloader[0]. [0] https://github.com/graphql/dataloader
  8. …that query can be as complex as you like. In order to avoid N+1 queries, you should use dataloader: https://github.com/graphql/dataloader . You can also join additional data to reference in deeper resolvers, but that's an antipattern AFAIK.
    comment by beaconstudios · 2022-04-04 · in RedwoodJS 1.0
  9. A dataloader implementation is your first step. https://github.com/graphql/dataloader
    comment by millerm · 2021-05-31 · in GraphQL Conf. 2021
  10. …is centralized. GraphQL (along with libs/frameworks) being one way to turn chatty into chunky. [1]: https://github.com/graphql/dataloader
    comment by jeswin · 2021-03-25 · in Edge Computing
  11. …need to be using some standardized way of grabbing objects by is (or edge), something like https://github.com/graphql/dataloader Whether it’s possible to do this efficiently I don’t know. At my last job we messed it up, and then we started…
  12. …complicates your servers, for sure, but pays dividends on performance/scale. How do you do that? https://github.com/graphql/dataloader However, to be super efficient you need to give up on some consistency. You simply can't have data…
  13. The n+1 problem can be fixed without introspection by using dataloaders: https://github.com/graphql/dataloader . It's actually quite pleasant to work with them, but it's definitely one more thing you need to know.
    comment by csnweb · 2020-11-08 · in Why not use GraphQL?
  14. …You can also implement things like Dataloader to batch/cache your requests: https://github.com/graphql/dataloader Hasura in particular implements two forms of caching. While not directly data-related, it does cache both the GraphQL qu
  15. …N+1 problem is welcome :) [0] https://itnext.io/what-is-the-n-1-problem-in-graphql-dd4921c... [1] https://github.com/graphql/dataloader
  16. …your requirements - Zeit: https://github.com/zeit Facebook: https://github.com/graphql/graphql-js , https://github.com/graphql/dataloader Misc: https://github.com/apollographql/apollo-server , https://github.com/tngan/samlify ,…
  17. …> But since GraphQL libs are now busy implementing caching What are you referring to? You mean like https://github.com/graphql/dataloader ? > in top of non-cacheable POST requests, this argument is lost on them. I think caching/serving…
    comment by dmitryminkovsky · 2019-07-05 · in Migrating to GraphQL: A Practical Assessment
  18. …args then batches those into an array of array of args for the underlying batched implementation. https://github.com/facebook/dataloader/blob/master/README.md
  19. …trying out a golang port [2] for a month or two and it really (really!) improves performance. [1] https://github.com/facebook/dataloader [2] https://github.com/graph-gophers/dataloader
  20. …[2] https://github.com/banterfm/graphql-crunch [3] https://www.apollographql.com/server [4] https://github.com/facebook/dataloader
  21. …the database. This is something you can do with a basic in-process caching tool called DataLoader: https://github.com/facebook/dataloader The second is about caching _across_ requests, something that people usually have special…
  22. …features like batching and caching which makes your life easier when opting for this solution. [1]: https://github.com/facebook/dataloader
  23. …resolver batching/caching layer (Facebook provides a library called DataLoader to facilitate this: https://github.com/facebook/dataloader ) or a query planner at your root resolver (like Join Monster: https://github.com/stems/join-monster…
    comment by lewisl9029 · 2017-08-13 · in JrGQL, a GraphQL alternative
  24. …prototyping a GraphQL API - Apollo Launchpad[6] - Try out GraphQL server code in your browser [1] https://github.com/facebook/dataloader [2] https://github.com/apollographql/apollo-client [3] https://dev-blog.apollodata.com/new-features-in-…
  25. To help solve the nested/recursive query problem, Facebook created dataloader: https://github.com/facebook/dataloader There's graphql integration info on the blog: http://graphql.org/blog/rest-api-graphql-wrapper/#taming-pat...
    comment by xdissent · 2017-08-04 · in Learn GraphQL with GitHub
  26. …And yeah, as you you mention, caching is usually important in such scenarios. In JS there's https://github.com/facebook/dataloader which help with the caching. I am using a Java implementation with Google's LoadingCache.
    comment by linkmotif · 2017-08-02 · in REST in Peace. Long Live GraphQL
  27. …I won't count it) 2) Request Batching This approach is popularised by Facebooks Dataloader library https://github.com/facebook/dataloader Instead of directly querying the database in the resolver, you return a specification of what data…
  28. …to do with a batching solution. I don't have all my links handy but here's one you can check out: https://github.com/facebook/dataloader If anyone has something to add please chime in! I'd love to hear how people are really using GraphQL…
  29. …number of levels) https://github.com/stems/join-monster (1 query, overhead for more than 2 levels) https://github.com/facebook/dataloader (best case, 1 query per level, in sequence )
  30. …[1] (also by Facebook) is a great tool used by a lot of GraphQL severs to solve this issue. [1] https://github.com/facebook/dataloader
  31. You can use something like dataloader[0] or haxl[1] to help with this issue. [0]: https://github.com/facebook/dataloader [1]: https://github.com/facebook/Haxl
    comment by biscarch · 2016-09-14 · in The GitHub GraphQL API
  32. …https://github.com/shopify/graphql-batch which was designed to solve this problem. This is similar to https://github.com/facebook/dataloader which solves the same problem for javascript.
    comment by dylants · 2016-09-14 · in The GitHub GraphQL API
  33. …a caching mechanism (likve Varnish) in your HTTP layer, you could have it in your GraphQL backend. https://github.com/facebook/dataloader
  34. …caching and a normalized architecture is (almost) as performant as a demoralized one. Check out https://github.com/facebook/dataloader We use it to do cross service joins in the form of bulk requests in a very transparent way.
    comment by jtmarmon · 2016-01-10 · in Analysis of Software Architectures
  35. …to load new rows but { mother { name }, father { name } } does need to load new rows. DataLoader ( https://github.com/facebook/dataloader ) is a small utility which makes batching and caching database requests straight forward.
    comment by leebyron · 2015-10-08 · in Thinking in GraphQL
  36. …database, with relationships, which is similar to the first project I'm planning on trying it with: https://github.com/facebook/dataloader#using-with-graphql
    comment by insin · 2015-10-08 · in Thinking in GraphQL