graphql-api icon indicating copy to clipboard operation
graphql-api copied to clipboard

Transforming Handler

Open dmjio opened this issue 7 years ago • 5 comments

Is there currently a way (and if not, a plan) for supporting any other Monad besides Handler when resolving queries / mutations? servant accomplishes through a monad morphism. I'd really like to be able to further transform Handler. If this is not supported, and there is no current architecture for doing so, I wouldn't mind giving this a shot. Do advise. cc @jml

dmjio avatar Jun 01 '18 00:06 dmjio

All through Handler as of today. What other monad do you want to use? On Fri, 1 Jun 2018 at 01:49, David Johnson [email protected] wrote:

Is there currently a way (and if not, a plan) for supporting any other Monad besides Handler when resolving queries / mutations? servant accomplishes through a monad morphism. I'd really like to be able to further transform Handler. If this is not supported, and there is no current architecture for doing so, I wouldn't mind giving this a shot. Do advise.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/haskell-graphql/graphql-api/issues/185, or mute the thread https://github.com/notifications/unsubscribe-auth/AAHq6us7NjYJU5kXN_A4RYkjItNhX3Ioks5t4I-PgaJpZM4UV8Am .

jml avatar Jun 01 '18 05:06 jml

I want to be able to use any monad. All I should need to provide is a function that can get back to Handler from my custom monad.

Sent from my iPhone

On Jun 1, 2018, at 1:34 AM, Jonathan Lange [email protected] wrote:

All through Handler as of today. What other monad do you want to use? On Fri, 1 Jun 2018 at 01:49, David Johnson [email protected] wrote:

Is there currently a way (and if not, a plan) for supporting any other Monad besides Handler when resolving queries / mutations? servant accomplishes through a monad morphism. I'd really like to be able to further transform Handler. If this is not supported, and there is no current architecture for doing so, I wouldn't mind giving this a shot. Do advise.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/haskell-graphql/graphql-api/issues/185, or mute the thread https://github.com/notifications/unsubscribe-auth/AAHq6us7NjYJU5kXN_A4RYkjItNhX3Ioks5t4I-PgaJpZM4UV8Am .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

dmjio avatar Jun 01 '18 09:06 dmjio

I'm not rejecting your use case—it's a good point. I'm just curious as to the specific motivation.

By all means, do give this a shot.

jml avatar Jun 01 '18 09:06 jml

For example, ReaderT r IO would be a monad I’d like to use. Would it be as simple as making an instance for HasResolver?

dmjio avatar Jun 01 '18 09:06 dmjio

I genuinely don’t know. I’d look at what servant does and try to copy from that. On Fri, 1 Jun 2018 at 10:37, David Johnson [email protected] wrote:

For example, ReaderT r IO would be a monad I’d like to use. Would it be as simple as making an instance for HasResolver?

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/haskell-graphql/graphql-api/issues/185#issuecomment-393828535, or mute the thread https://github.com/notifications/unsubscribe-auth/AAHq6uAgkThzowtmUGLM61gSFOkGszhxks5t4QtegaJpZM4UV8Am .

jml avatar Jun 01 '18 12:06 jml