I've only ever seen DataLoader used for batching database queries, how do you create a single source of truth for authorization with it? Do you have a code snippet somewhere?
Check out this article [1] (or video) on Dan Schafer's talk, on how they use Dataloader and GraphQL internally at Facebook. Covers most of it.
To summarize, they create a class for each GraphQLType which has their own "gen" function such that it is the only way to generate data. This way you get a single source of truth.
There's also a video of Lee Byron going through Dataloader's source code which was pretty fun to watch.
To summarize, they create a class for each GraphQLType which has their own "gen" function such that it is the only way to generate data. This way you get a single source of truth.
There's also a video of Lee Byron going through Dataloader's source code which was pretty fun to watch.
[1]: https://dev-blog.apollodata.com/graphql-at-facebook-by-dan-s...