Graphcool / graphcool-framework

Apache License 2.0
1.77k stars 131 forks source link

Hot reloading for functions resolvers' local development #418

Open marktani opened 6 years ago

marktani commented 6 years ago

Issue by levioza Wednesday Nov 22, 2017 at 23:57 GMT Originally opened as https://github.com/graphcool/prisma/issues/1319


Feature Request

First, I would like to mention that I was blown away by graph.cool and its local development support. So, keep up the great work :)

However, one of the challenges while developing in a serverless environment is the inability to detect errors fast and act accordingly. So, I need to re-deploy every change while developing a resolver function and this is a time-consuming process.

Implementation proposal

It's true that I'm not familiar with Graph.cool's internals. However, I believe that if you could provide a node.js server locally (On the development machine/Not on docker) and then proxying all the resolvers functions between the local node server and the docker's node server. I believe that this will do the trick.

Thank you for your consideration.

marktani commented 6 years ago

Comment by kbrandwijk Thursday Nov 23, 2017 at 01:27 GMT


The graphcool deploy command already has a --watch parameter, that will watch for file changes and deploy those. Is that what you are looking for?

marktani commented 6 years ago

Comment by levioza Thursday Nov 23, 2017 at 01:44 GMT


@kbrandwijk Thank you for your reply.

I've just tried --watch... I can see that the command re-bundle the entire functions on file changes. So, the operation takes some time. I believe that implementing a proxy will be much faster as there's no need to re-bundle everything on every change.

What do you think?