Skip to content

docs: Post_body example in production guide uses undefined obj variable #4765

Description

@fallintoplace

Description

The example in website/pages/docs/going-to-production.mdx under the authentication/authorization section defines the resolver as function Post_body(source, args, context, info), but the body passes post: obj into postRepository.getBody(...).

Because obj is not defined in the snippet, copying the example throws immediately. It looks like the intended variable is source.

Current snippet

function Post_body(source, args, context, info) {
  // return the post body only if the user is the post's author
  return postRepository.getBody({ user: context.user, post: obj })
}

Expected snippet

function Post_body(source, args, context, info) {
  // return the post body only if the user is the post's author
  return postRepository.getBody({ user: context.user, post: source })
}

History

This appears to have been introduced in PR #4398 (docs: update "going to production" guide).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions