@@ -370,7 +370,7 @@ var UserType = new GraphQLObjectType({
370370
371371In many applications, a web server using DataLoader serves requests to many
372372different users with different access permissions. It may be dangerous to use
373- one cache across many users, and is encouraged to create a new cache
373+ one cache across many users, and is encouraged to create a new DataLoader
374374per request:
375375
376376``` js
@@ -382,16 +382,16 @@ function createLoaders(authToken) {
382382 };
383383}
384384
385- // Later, in an web request handler :
385+ // When handling an incoming web request:
386386var loaders = createLoaders (request .query .authToken );
387387
388388// Then, within application logic:
389389var user = await loaders .users .load (4 );
390390var pic = await loaders .cdnUrls .load (user .rawPicUrl );
391391```
392392
393- Creating an object where each key is a ` DataLoader ` is also a common pattern.
394- This provides a single value to pass around to code which needs to perform
393+ Creating an object where each key is a ` DataLoader ` is one common pattern which
394+ provides a single value to pass around to code which needs to perform
395395data loading, such as part of the ` rootValue ` in a [ graphql-js] [ ] request.
396396
397397### Loading by alternative keys.
@@ -424,7 +424,8 @@ cache. More specifically, any object that implements the methods `get()`,
424424` set() ` , ` delete() ` and ` clear() ` can be provided. This allows for custom Maps
425425which implement various [ cache algorithms] [ ] to be provided. By default,
426426DataLoader uses the standard [ Map] [ ] which simply grows until the DataLoader
427- is released.
427+ is released. The default is appropriate when requests to your application are
428+ short-lived.
428429
429430
430431## Common Back-ends
0 commit comments