Hi Everyone,
I attempt to use Federation to consolidate all subgraphs.
However, I ran into the problem after hooking up with the first subgraph.
Anything I need to do on my end to make this work and my “https://XXXXX/graphql” is working great.
Thanks,
Jdang
import { ApolloServer } from 'apollo-server';
import { ApolloServerExpressConfig } from 'apollo-server-express';
const { ApolloGateway,IntrospectAndCompose } = require("@apollo/gateway");
const gateway = new ApolloGateway({
supergraphSdl: new IntrospectAndCompose({
subgraphs: [
{ name: 'users', url: 'https://XXXXX/graphql' },
// ...additional subgraphs...
],
}),
});
const url = "http://localhost:5002/"
let config : ApolloServerExpressConfig = { gateway: gateway}
const server = new ApolloServer(config);
server.listen().then(({ url }) => {
console.log(`Server ready at url: ${url}`);
});