@apollo/gateway
    TypeScript icon, indicating that this package has built-in type declarations

    2.0.5 • Public • Published

    Apollo Gateway

    This package provides utilities for combining multiple GraphQL microservices into a single GraphQL endpoint.

    Each microservice should implement the federation schema specification. This can be done either through Apollo Federation or a variety of other open source products.

    For complete documentation, see the Apollo Gateway API reference.

    Usage

    const { ApolloServer } = require("apollo-server");
    const { ApolloGateway, IntrospectAndCompose } = require("@apollo/gateway");
    
    const gateway = new ApolloGateway({
      supergraphSdl: new IntrospectAndCompose({
        subgraphs: [
           { name: "accounts", url: "http://localhost:4001/graphql" }
           // List of federation-capable GraphQL endpoints...
        ],
      }),
    });
    
    const server = new ApolloServer({ gateway });
    
    server.listen().then(({ url }) => {
      console.log(`🚀 Server ready at ${url}`);
    });

    Install

    npm i @apollo/gateway

    DownloadsWeekly Downloads

    385,847

    Version

    2.0.5

    License

    SEE LICENSE IN ./LICENSE

    Unpacked Size

    830 kB

    Total Files

    194

    Last publish

    Collaborators

    • apollo-bot