prisma-labs / yoga2

A lightweight 'Ruby on Rails'-like framework for GraphQL
https://www.graphql.yoga
MIT License
347 stars 14 forks source link

Initialize scaffolding command through `yoga dev` #30

Open Weakky opened 5 years ago

Weakky commented 5 years ago

Description

In order to remove friction in the development workflow, we could introduce a way to execute commands without having to kill the yoga process, run the command, and re-run yoga dev

Proposal

One use-case would be the scaffold command.

$ yoga dev
** Starting **
πŸš€  Server ready at http://localhost:4000/
scaffold
? Input the name of your type: Test
Scaffolded new file at ./src/graphql/Test.ts

Next steps:

- Go to ./src/graphql/Test.ts
- Expose your fields
** Restarting **
πŸš€  Server ready at http://localhost:4000/
kandros commented 5 years ago

Jest’s interactive cli when in watch mode is a great example of such behaviour.