Skip to content

Commit 80c6508

Browse files
docs: fix Post_body example variable (#4767)
## Summary - replace the undefined `obj` variable with `source` in the `Post_body` resolver example - keep the change scoped to the production guide docs example only ## Why The current snippet defines `function Post_body(source, args, context, info)` but passes `post: obj`, which is undefined and causes the copied example to fail immediately. Closes #4765. ## Validation - `npx --yes prettier@2.6.2 --check website/pages/docs/going-to-production.mdx` - `git diff --check`
1 parent b43ccb1 commit 80c6508

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

website/pages/docs/going-to-production.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ const postRepository = {
149149
// Resolver for the `Post.body` field:
150150
function Post_body(source, args, context, info) {
151151
// return the post body only if the user is the post's author
152-
return postRepository.getBody({ user: context.user, post: obj })
152+
return postRepository.getBody({ user: context.user, post: source })
153153
}
154154
```
155155

0 commit comments

Comments
 (0)