Complete the code to define a basic gateway that composes two services.
const gateway = new ApolloGateway({ serviceList: [[1]] });The serviceList expects an array of service definitions with name and url keys.
Complete the code to start the Apollo Gateway server on port 4000.
gateway.listen({ port: [1] }).then(({ url }) => { console.log(`Gateway ready at ${url}`); });The gateway server is commonly started on port 4000 to avoid conflicts with underlying services.
Fix the error in the service list by completing the missing key.
const serviceList = [{ [1]: 'users', url: 'http://localhost:4001/graphql' }];endpoint or serviceName instead of name.The key name is required to identify the service in the gateway's service list.
Fill both blanks to create a gateway that composes two services and logs the URL when ready.
const gateway = new ApolloGateway({ serviceList: [1] });
gateway.listen().then(({ [2] }) => console.log(`Gateway running at ${url}`));address or endpoint.The serviceList must be an array of service objects, and the listen method returns an object with a url property.
Fill all three blanks to define a gateway with three services and start it on port 5000.
const gateway = new ApolloGateway({ serviceList: [1] });
gateway.listen({ port: [2] }).then(({ [3] }) => console.log(`Gateway ready at ${url}`));The serviceList is an array of three service objects, the gateway listens on port 5000, and the listen method returns an object with a url property.