Skip to content

Commit d20ddbf

Browse files
committed
Update README.md
Fix #7
1 parent 8cbaae2 commit d20ddbf

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

README.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -236,8 +236,8 @@ var UserType = new GraphQLObjectType({
236236
args: {
237237
first: { type: GraphQLInt }
238238
},
239-
type: new GraphQLList(UserType)
240-
resolve (user, { first }) => queryLoader.load([
239+
type: new GraphQLList(UserType),
240+
resolve: (user, { first }) => queryLoader.load([
241241
'SELECT toID FROM friends WHERE fromID=? LIMIT ?', user.id, first
242242
]).then(rows => rows.map(row => userLoader.load(row.toID)))
243243
}
@@ -301,7 +301,7 @@ var redisLoader = new DataLoader(keys => new Promise((resolve, reject) => {
301301
result !== null ? result : new Error(`No key: ${keys[index]}`)
302302
));
303303
});
304-
});
304+
}));
305305
```
306306

307307

@@ -359,9 +359,7 @@ var userLoader = new DataLoader(ids => {
359359
var query = `SELECT * FROM users WHERE id IN (${params})`;
360360
return queryLoader.load([query, ids]).then(
361361
rows => ids.map(
362-
id => rows.find(
363-
row => row.id === id) || new Error(`Row not found: ${id}`
364-
)
362+
id => rows.find(row => row.id === id) || new Error(`Row not found: ${id}`)
365363
)
366364
);
367365
});

0 commit comments

Comments
 (0)