Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass data among resolvers #45

Open
alexluong opened this issue Oct 18, 2018 · 0 comments
Open

Pass data among resolvers #45

alexluong opened this issue Oct 18, 2018 · 0 comments

Comments

@alexluong
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant