Skip to content
This repository has been archived by the owner on Mar 20, 2023. It is now read-only.

Middleware within express-graphql? #208

Closed
i-am-tom opened this issue Feb 4, 2017 · 1 comment
Closed

Middleware within express-graphql? #208

i-am-tom opened this issue Feb 4, 2017 · 1 comment

Comments

@i-am-tom
Copy link

i-am-tom commented Feb 4, 2017

Hello! First of all, thank you for this project - it's great!

Secondly, I think #113 is one solution to my problem, but I'm hoping there's another in the mean time...

I've written my app using free monad machinery with my own little DSL. So, for a route that is meant to return a String, the route actually produces a Free[DB, String]. What I'd like to do is be able to set some global middleware just before the stage that says "the types don't match up" that can run the route's output through an interpreter to get out what's needed (most likely a Promise[GraphQLError, String]).

tl;dr: can middleware be placed after execution of a resolver and before validation?

Thanks in advance :)

@wincent
Copy link
Contributor

wincent commented Feb 6, 2017

At the moment, I don't think there's a way to do this, short of forking the project. I think, like you say, that #113 will be the eventual answer, so I'm going to close this one as a duplicate. Thanks for your question!

@wincent wincent closed this as completed Feb 6, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants