Skip to content

Commit c5b7157

Browse files
Update guides.md (#616)
The current code causes error, since it tries to access other service which is not defined in the service. Only changes main fastJoin example, everything else might need some review.
1 parent c2d8d7a commit c5b7157

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

docs/guides.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,18 +111,18 @@ const { fastJoin } = require('feathers-hooks-common')
111111

112112
const postResolvers = {
113113
joins: {
114-
author: (...args) => async post => {
114+
author: (...args) => async (post, { app }) => {
115115
post.author = (
116-
await users.find({
116+
await app.services('users').find({
117117
query: {
118118
id: post.userId
119119
}
120120
})
121121
)[0]
122122
},
123123

124-
starers: $select => async post => {
125-
post.starers = await users.find({
124+
starers: $select => async (post, { app }) => {
125+
post.starers = await app.services('users').find({
126126
query: {
127127
id: { $in: post.starIds },
128128
$select: $select || ['name']

0 commit comments

Comments
 (0)