Skip to content

Commit a8af693

Browse files
committed
More minor edits to Readme
Inspired by #62
1 parent ace12af commit a8af693

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ var UserType = new GraphQLObjectType({
370370

371371
In many applications, a web server using DataLoader serves requests to many
372372
different 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
374374
per 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:
386386
var loaders = createLoaders(request.query.authToken);
387387

388388
// Then, within application logic:
389389
var user = await loaders.users.load(4);
390390
var 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
395395
data 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
425425
which implement various [cache algorithms][] to be provided. By default,
426426
DataLoader 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

Comments
 (0)