How to use the apollo-server.makeRemoteExecutableSchema function in apollo-server

To help you get started, we’ve selected a few apollo-server examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github hasadna / open_pension / gateway / src / schema-stitching / index.ts View on Github external
async function createRemoteSchema(serviceName) {
    const link = new HttpLink({uri: `http://${serviceName}`, fetch});

    let schema;
    try {
        schema = await retry(() => introspectSchema(link), 5);
        return makeRemoteExecutableSchema({schema, link});
    } catch (err) {
        return undefined;
    }
}