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

support middleware #194

Closed
beeplin opened this issue Mar 9, 2019 · 1 comment
Closed

support middleware #194

beeplin opened this issue Mar 9, 2019 · 1 comment

Comments

@beeplin
Copy link
Contributor

beeplin commented Mar 9, 2019

graphql-nexus/nexus#64 discusses the possibility of introducing middleware in nexus type definition to facilitate the re-usability of auth/validation logics in resolvers. Similarly, it would be nice if nexus-primsa could support middleware, maybe like this:

const Query = prismaObjectType({
  name: 'Query',
  definition(t) {
    t.prismaFields(['user', { name: 'users', middleware: [middleware1, middleware2] }])
  },
})
@Weakky
Copy link
Member

Weakky commented Mar 9, 2019

As nexus-prisma is just a wrapper around nexus, once nexus implements it, all the middleware will magically be able for nexus-prisma as well 🙂

@Weakky Weakky closed this as completed Mar 9, 2019
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

2 participants