-
Notifications
You must be signed in to change notification settings - Fork 331
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
Service Polling / Live Schema Updates - Possible? #1142
Comments
I need this too. |
I need this too. Only way to do is to restart the mesh serve process and that will not be so nice once its deployed to production :/ |
Right now I'm using mesh in front of Hasura, I have them both running in local for development. What I do is :
The scripts look like this : "graphql-codegen:get-schema": "concurrently yarn:graphql-codegen:get-schema-*",
"graphql-codegen:on-hasura-change": "chokidar \"packages/server/hasura/**/*\" --command \"yarn workspace @clovis/server run proxy:reload && yarn graphql-codegen:get-schema\" --silent", "proxy:dev": "nodemon --watch .meshrc.yml --watch src/app/proxy --exec yarn proxy:start",
"proxy:start": "wait-port http://localhost:8080/healthz && mesh dev --dir src/app/proxy --require dotenv/config",
"proxy:reload": "cat .meshrc.yml | tee .meshrc.yml > /dev/null", To simplify everything it would be awesome if |
I know this is not ideal, but here is another approach using Docker and Kubernetes. In my FROM node:16.13-alpine
# ...
RUN npm i -g pm2
# ...
ENTRYPOINT ["/bin/sh", "/app/update-schemas.sh"]
CMD pm2-runtime '/app/node_modules/.bin/mesh start' --no-autorestart --wait-ready --name mesh --listen-timeout 15000 Then in my nohup sh -c "sleep 60 && yarn mesh build && pm2 reload all"
export $NEXT_RESTART_MINUTE=`date +"%M"`
echo "$NEXT_RESTART_MINUTE * * * * cd /app && yarn mesh build && pm2 reload all" >> /etc/crontab/root
crond -l 2 -f > /dev/stdout 2> /dev/stderr &
exec "$@" What's happening here:
A few gotchas:
|
It is possible to have the mesh gateway poll running services for schema changes? Or trigger it to reload its sources somehow?
Current code snippet I am experimenting with:
The text was updated successfully, but these errors were encountered: