Glavin001/graphql-sequelize-crud

Add pre- and post-resolve hooks

Open

#24 opened on May 4, 2017

View on GitHub
 (0 comments) (0 reactions) (0 assignees)TypeScript (23 forks)github user discovery
featuregood first issue

Repository metrics

Stars
 (128 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

Hi!

I'm thinking of using this library, but I was asking myself how I could manage authentication with it (for example with express-jwt or express-session). More specifically, I would pass the token info into the context argument of the resolve function, but with this library I cannot access this resolve function anymore (unless in a custom query, but that's not what I want).

So my idea is to add pre and post hooks on every CRUD action that users can configure themselves. Similar to what is done here: https://github.com/RisingStack/graffiti-mongoose.

Any thoughts about this?

Contributor guide