You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The issue is due to an update made to Apollo Gateway in version 0.23.0 noted in their changelog
If you are on v2.18 or v2.19 of Apollo Server, you should upgrade to Apollo Server v2.20 before upgrading to this version, or your Node process may not shut down properly after stopping your Apollo Server.. Code that calls ApolloGateway.load is now expected to call ApolloGateway.stop. If you don't do that and you're using managed federation or experimental_pollInterval, the background polling interval will now keep a Node process alive rather than allowing it to exit if it's the only remaining event loop handler. Generally, ApolloServer is what calls ApolloGateway.load, and if you use at least v2.20.0 of Apollo Server, ApolloServer.stop() will invoke ApolloGateway.stop(). There's a bit of a hack where ApolloGateway does the old behavior if it believes that it is being called by a version of Apollo Server older than v2.18.0. So if you are manually calling ApolloGateway.load from your code, make sure to call ApolloGateway.stop when you're done, and don't use this version with Apollo Server v2.18 or v2.19. PR #452 apollo-server Issue #4428
I tried adding a gateway.stop() before, after, and other places but that didn't help this issue. I am not sure what it is looking for here or how to resolve this surprising state.
@apollo/gateway version currently locked at "0.22.0"
NOTE
A very strange aspect of this is that currently in production the package.json file has @apollo/gateway 0.23.0 listed and the refresh request works as expected. Locally, this isn't the case, even using that same version.
Looking at @apollo/gateway source, I don't see how we can get the correct state of initialized when calling load(). It seems we need to rethink the approach we are using to update the gateway when children are reloaded/deployed/etc.
publicasyncload(options?: {apollo?: ApolloConfig;engine?: GraphQLServiceEngineConfig;}){if(this.state.phase!=='initialized'){throwError(`ApolloGateway.load called in surprising state ${this.state.phase}`,);}
....
Came across this issue in the Apollo Federation repo: apollographql/federation#461
It describes another user losing their ability to run ApolloGateway.load() to refresh schemas.
The text was updated successfully, but these errors were encountered:
Came across this issue in the Apollo Federation repo: apollographql/federation#461
It describes another user losing their ability to run ApolloGateway.load() to refresh schemas.
Calling ApolloGateway.load() throws the error
Error: ApolloGateway.load called in surprising state loaded
We call this at,
that-api-gateway/src/index.js
Line 64 in a51a703
The issue is due to an update made to Apollo Gateway in version
0.23.0
noted in their changelogI tried adding a gateway.stop() before, after, and other places but that didn't help this issue. I am not sure what it is looking for here or how to resolve this
surprising
state.@apollo/gateway version currently locked at "0.22.0"
NOTE
A very strange aspect of this is that currently in production the
package.json
file has@apollo/gateway 0.23.0
listed and the refresh request works as expected. Locally, this isn't the case, even using that same version.Looking at @apollo/gateway source, I don't see how we can get the correct state of
initialized
when callingload()
. It seems we need to rethink the approach we are using to update the gateway when children are reloaded/deployed/etc.https://github.com/apollographql/federation/blob/e3b3035711d31f60a053ceafa3828666fe808435/gateway-js/src/index.ts#L266-L274
Came across this issue in the Apollo Federation repo: apollographql/federation#461
It describes another user losing their ability to run
ApolloGateway.load()
to refresh schemas.The text was updated successfully, but these errors were encountered: