Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Pass data among resolvers #45

Copy link
Copy link
Open
@alexluong

Description

@alexluong
Issue body actions

Hi. I recently used this library and really enjoy it. I wonder if there's anyway if we can pass data from a resolver to another.

For example, let's say I have a resolver isStatusOwnerResolver like this:

export const isStatusOwnerResolver = isAuthenticatedResolver.createResolver(
  async (root, { statusId }, { userId, models: { Status } }) => {
    const status = await Status.findById(statusId)
    if (status.ownerId.toString() !== userId) {
      throw new NotStatusOwnerError()
    }
  },
)

Is there anyway I can pass status to the resolver that is chained from isStatusOwnerResolver?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.