Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[improvement] Reload server after change #1906

Open
nemonemi opened this issue Apr 6, 2021 · 4 comments
Open

[improvement] Reload server after change #1906

nemonemi opened this issue Apr 6, 2021 · 4 comments
Labels

Comments

@nemonemi
Copy link
Contributor

nemonemi commented Apr 6, 2021

Is your feature request related to a problem? Please describe.

Currently, after every change, for example in the .yaml file, the mesh serve has to be restarted for the change to be applied.

Describe the solution you'd like

With each change the changes to be persisted.

@ardatan ardatan added the feature label Apr 6, 2021
@santino
Copy link
Contributor

santino commented Apr 6, 2021

Surely this can be baked into the serve command for convenience.

However, in the meantime, you can simply implement this with nodemon.
You could take inspiration from the following command to be configured in your package.json

   "dev": "nodemon -e js,graphql,yaml --exec graphql-mesh serve"

You'd just need to install nodemon as a dev dependency.

@nemonemi
Copy link
Contributor Author

nemonemi commented Apr 6, 2021

Thanks, @santino, however, the changes are detected for the files other than yaml. I've achieved it by explicitly watching the changes in the .meshrc.yaml file. e.g. "nodemon -e ts,graphql -w .meshrc.yaml --exec mesh serve"

As we've both agreed, this should be baked into the serve command for convenience. On top of that, the improvement would be that the currently opened graphiql is reloaded (it would be great if it would be hot reloaded), and not opened in a new tab.

@nemonemi nemonemi changed the title Reload server after change [improvement] Reload server after change Apr 6, 2021
@nemonemi
Copy link
Contributor Author

nemonemi commented May 18, 2021

@Urigo could reloading server after file changes be achieved on the library level?

@kyuumeitai
Copy link

Hi there, just a little observation:
In my case, I was using the .meshrc.yaml and by being a hidden file (mind the dot at the beginning) the nodemon that works for me is explicitly calling that file, given that nodemon doesn't watch hidden files by default.

ie.: "dev": "nodemon --watch .meshrc.yaml --exec mesh dev" in your scripts's package.json.

Hope helps someone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants