After reading the Apollo docs on managed federation, I configured my Apollo Gateway exactly as described in the article. Basically I didn't pass anything to the ApolloGateway
constructor. The ENGINE_API_KEY
is provided in my .env file and should be picked up by the ApolloGateway instance.
What does this first warning mean? Is that message normal and expected if no schema updates are availlable?
Why is the GraphQL schema undefined even after apollo-server sais Gateway successfully loaded schema.?
I know this kind of conflicting output from other occasions where a promise isn't resolved before passed to another function or constructor. Do I have to somehow await ApolloGateway to fetch all services before passing it to ApolloServer? How should I best do that?
[WARN] Tue Nov 05 2019 12:58:26 GMT+0100 (GMT+01:00) apollo-gateway: Error checking for schema updates. Falling back to existing schema. Error: When `serviceList` is not set, an Apollo Engine configuration must be provided. See https://www.apollographql.com/docs/apollo-server/federation/managed-federation/ for more information.
at ApolloGateway.<anonymous> (e:\OneDrive\Dokumente\Projekte\BLEND-LMS\server\API\node_modules\@apollo\gateway\src\index.ts:464:13)
at Generator.next (<anonymous>)
at e:\OneDrive\Dokumente\Projekte\BLEND-LMS\server\API\node_modules\@apollo\gateway\dist\index.js:8:71
at new Promise (<anonymous>)
at __awaiter (e:\OneDrive\Dokumente\Projekte\BLEND-LMS\server\API\node_modules\@apollo\gateway\dist\index.js:4:12)
at ApolloGateway.loadServiceDefinitions (e:\OneDrive\Dokumente\Projekte\BLEND-LMS\server\API\node_modules\@apollo\gateway\dist\index.js:260:16)
at ApolloGateway.<anonymous> (e:\OneDrive\Dokumente\Projekte\BLEND-LMS\server\API\node_modules\@apollo\gateway\src\index.ts:285:27)
at Generator.next (<anonymous>)
at e:\OneDrive\Dokumente\Projekte\BLEND-LMS\server\API\node_modules\@apollo\gateway\dist\index.js:8:71
at new Promise (<anonymous>)
[INFO] Tue Nov 05 2019 12:58:26 GMT+0100 (GMT+01:00) apollo-gateway: Gateway successfully loaded schema.
* Mode: managed
� Server ready at http://localhost:4000/
(node:9836) UnhandledPromiseRejectionWarning: Error: Expected undefined to be a GraphQL schema.
at assertSchema (e:\OneDrive\Dokumente\Projekte\BLEND-LMS\server\API\node_modules\graphql\type\schema.js:41:11)
at validateSchema (e:\OneDrive\Dokumente\Projekte\BLEND-LMS\server\API\node_modules\graphql\type\validate.js:44:28)
at assertValidSchema (e:\OneDrive\Dokumente\Projekte\BLEND-LMS\server\API\node_modules\graphql\type\validate.js:68:16)
at assertValidExecutionArguments (e:\OneDrive\Dokumente\Projekte\BLEND-LMS\server\API\node_modules\graphql\execution\execute.js:136:35)
at executeImpl (e:\OneDrive\Dokumente\Projekte\BLEND-LMS\server\API\node_modules\graphql\execution\execute.js:86:3)
at Object.execute (e:\OneDrive\Dokumente\Projekte\BLEND-LMS\server\API\node_modules\graphql\execution\execute.js:64:63)
at Object.generateSchemaHash (e:\OneDrive\Dokumente\Projekte\BLEND-LMS\server\API\node_modules\apollo-server-core\src\utils\schemaHash.ts:11:18)
at ApolloServer.generateSchemaDerivedData (e:\OneDrive\Dokumente\Projekte\BLEND-LMS\server\API\node_modules\apollo-server-core\src\ApolloServer.ts:486:24)
at e:\OneDrive\Dokumente\Projekte\BLEND-LMS\server\API\node_modules\apollo-server-core\src\ApolloServer.ts:366:14
at processTicksAndRejections (internal/process/task_queues.js:93:5)
(node:9836) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:9836) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
(node:9836) PromiseRejectionHandledWarning: Promise rejection was handled asynchronously (rejection id: 2)