Automatic reloading of the gateway can be an issue, even with wait-on in place. You may want to look at some experimental features of Apollo Gateway (github.com/apollographql/federatio...) to help facilitate this, or look into managed federation instead.
importwaitOnfrom'wait-on'importappfrom'./config/app'importserverfrom'./config/apollo'constport=process.env.PORTconstoptions={resources:['tcp:4001'],}waitOn(options).then(()=>{server.applyMiddleware({app})app.listen({port},()=>{console.log(`Server ready at http://localhost:${port}${server.graphqlPath}`)})}).catch((err)=>{console.error('ERR:',err)})
Give this a try!
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Automatic reloading of the gateway can be an issue, even with wait-on in place. You may want to look at some experimental features of Apollo Gateway (github.com/apollographql/federatio...) to help facilitate this, or look into managed federation instead.
Easy solution to the development problem I referenced is to use wait-on in index.js before building the gateway rather than in the command line.
This way when nodemon restarts the gateway server it waits for the other services on every restart, not just the first time we run the command.
Thought I'd mention this for anyone who ran into the same problem.
Hi, can you give an example on how you solved this? I'm facing the same issue but can't make it work.
Give this a try!