2.9.3 • Published 2 months ago

@apollo/subgraph v2.9.3

Weekly downloads
-
License
MIT
Repository
github
Last release
2 months ago

Apollo Subgraph

This package provides utilities for creating GraphQL microservices, which can be combined into a single endpoint through tools like Apollo Gateway.

For complete documentation, see the Apollo Subgraph API reference.

Usage

import { ApolloServer } from '@apollo/server';
import { startStandaloneServer } from '@apollo/server/standalone';
import { gql } from 'graphql-tag';
import { buildSubgraphSchema } from '@apollo/subgraph';

const typeDefs = gql`
  type Query {
    me: User
  }

  type User @key(fields: "id") {
    id: ID!
    username: String
  }
`;

const resolvers = {
  Query: {
    me() {
      return { id: "1", username: "@ava" }
    }
  },
  User: {
    __resolveReference(user, { fetchUserById }){
      return fetchUserById(user.id)
    }
  }
};

const server = new ApolloServer({
  schema: buildSubgraphSchema([{ typeDefs, resolvers }])
});

// Note the top-level await!
const { url } = await startStandaloneServer(server);
console.log(`🚀  Server ready at ${url}`);
@withjoy/server-core@infinitebrahmanuniverse/nolb-_apo@everything-registry/sub-chunk-74@itoa/gateway@itoa/itoa@turnly/graphqlsgnm-neo4j-graphqlresource-management-servicevscode-apollosb-apollo-subgraphmtx-graphql-servergraphql-schema-aware-anygraphql-inherits-directiveicarus-graphqlkeycloak-connect-graphql-multirealmkeycloak-connect-graphql-multirealm-v4postgraphile-federation-pluginnestjs-libtreemonitor-npmtrixian-api@apollo/federation@ailo/graphql-server@bugslifesolutions/api-core@codezo/shared@devpira/create-subgraph@daryl-software/graphql-helperszugzwang-server@graphql-yoga/nestjs-federation@greendistrict/api@graphql-mesh/transform-federation@eventicle/eventicle-extension-lib@genesisx/graphql-utils@infotrends/apollo-graphql-tools@last-rev/graphql-contentful-core@ltv/moleculer-apollo-server-mixin@maka/swagger2gql@neo4j/graphql@ezweb/graphql-helpers@kollate/graphql-utils@jeff-tian/graphql-transform-federation@jeantessier/book_reviews.node_graphql_federation.books@jeantessier/book_reviews.node_graphql_federation.jwts@jeantessier/book_reviews.node_graphql_federation.reviews@jeantessier/book_reviews.node_graphql_federation.search@jeantessier/book_reviews.node_graphql_federation.signatures@jeantessier/book_reviews.node_graphql_federation.users@pothos-examples/prisma-federation@profusion/apollo-federation-node-gateway@sawayo/docu-check@opencreek/neo4j-graphql@pocket-tools/apollo-utils@ocopjs/ocop@occupop/lib-graphql@operato/auth@operato/account@operato/publisher@operato/keycloak@operato/scheduler@dits/dits-apollo@craft.co/graphql-transform-federation-v2@comico/users@pothos-examples/federation@powerhousedao/reactor-api@powerhousedao/reactor-localcontentful-apollo-federation@threads/apollo-resolver-typesesante-questionnaire@wayfair/gqmock@zicenter/anteek-coreahau-graphql-serveracen-graphql-template@xxskyy/mercurius-exec-service-schemafurkan-test-commons-serviceapollo-startercitisys-utilsclevershop-be-commoncm-libs-bootstrap
2.9.3

2 months ago

2.9.2

3 months ago

2.9.1

3 months ago

2.9.0

4 months ago

2.10.0-alpha.2

3 months ago

2.10.0-alpha.1

4 months ago

2.8.1

6 months ago

2.8.0

7 months ago

2.8.0-connectors.5

7 months ago

2.8.3-beta.0

6 months ago

2.8.3-beta.1

5 months ago

2.8.3-beta.2

5 months ago

2.8.3

5 months ago

2.8.2

6 months ago

2.8.5

4 months ago

2.8.4

5 months ago

2.9.0-connectors.0

6 months ago

2.9.0-connectors.2

6 months ago

2.9.0-connectors.7

6 months ago

2.9.0-beta.0

4 months ago

2.9.0-connectors.8

5 months ago

2.9.0-connectors.9

5 months ago

2.8.0-alpha.1

7 months ago

2.10.0-alpha.0

4 months ago

2.7.8

7 months ago

2.7.8-alpha.0

7 months ago

2.8.0-alpha.0

7 months ago

2.8.0-connectors.4

7 months ago

2.8.0-connectors.3

7 months ago

2.8.0-connectors.1

7 months ago

2.8.0-connectors.2

7 months ago

2.8.0-connectors.0

8 months ago

2.7.7

8 months ago

2.7.6

8 months ago

2.7.5

8 months ago

2.7.4-testing.1

8 months ago

2.7.4

8 months ago

2.7.3

8 months ago

2.7.3-testing.0

9 months ago

2.7.2

9 months ago

2.7.1

11 months ago

2.7.0

11 months ago

2.6.3

12 months ago

2.6.2

1 year ago

2.6.1

1 year ago

2.6.0

1 year ago

2.5.7

1 year ago

2.5.6

1 year ago

2.5.5

1 year ago

2.4.13

1 year ago

2.4.10

1 year ago

2.4.12

1 year ago

2.4.11

1 year ago

2.4.9

1 year ago

2.5.0

1 year ago

2.5.2

1 year ago

2.5.1

1 year ago

2.5.4

1 year ago

2.5.3

1 year ago

2.4.7

2 years ago

2.4.8

2 years ago

2.4.3

2 years ago

2.4.2

2 years ago

2.4.5

2 years ago

2.4.4

2 years ago

2.3.6

2 years ago

2.4.6

2 years ago

2.4.0-alpha.0

2 years ago

2.4.0-alpha.1

2 years ago

2.3.0-beta.1

2 years ago

2.4.1

2 years ago

2.2.3

2 years ago

2.4.0

2 years ago

2.3.0-beta.2

2 years ago

2.3.0-beta.3

2 years ago

2.3.0

2 years ago

2.3.2

2 years ago

2.3.1

2 years ago

2.3.4

2 years ago

2.3.3

2 years ago

2.3.5

2 years ago

2.2.1

2 years ago

2.2.0

2 years ago

2.2.2

2 years ago

2.3.0-alpha.0

2 years ago

2.2.2-rc0

2 years ago

2.1.4

2 years ago

0.6.1

2 years ago

0.5.1

2 years ago

2.1.2

2 years ago

2.1.1

2 years ago

2.1.3

2 years ago

2.1.0

2 years ago

2.1.2-alpha.2

2 years ago

2.1.2-alpha.1

2 years ago

2.1.2-alpha.0

2 years ago

2.0.6-rc.1

3 years ago

2.0.6-rc.0

3 years ago

2.0.5

3 years ago

2.0.4

3 years ago

2.1.0-alpha.4

2 years ago

2.1.0-alpha.3

2 years ago

2.1.0-alpha.2

2 years ago

0.5.0

2 years ago

2.1.0-alpha.1

2 years ago

2.1.0-alpha.0

3 years ago

2.0.3

3 years ago

2.0.2

3 years ago

2.0.2-alpha.0

3 years ago

2.0.2-alpha.2

3 years ago

2.0.2-alpha.1

3 years ago

0.4.2

3 years ago

2.0.0-preview.12

3 years ago

2.0.0-preview.1

3 years ago

2.0.0-preview.13

3 years ago

2.0.0-preview.2

3 years ago

2.0.0-preview.10

3 years ago

2.0.0-preview.11

3 years ago

2.0.0-preview.0

3 years ago

2.0.0-preview.9

3 years ago

2.0.1

3 years ago

2.0.0-preview.7

3 years ago

2.0.0

3 years ago

2.0.0-preview.8

3 years ago

2.0.0-preview.14

3 years ago

0.4.1

3 years ago

0.4.0

3 years ago

0.3.3

3 years ago

2.0.0-alpha.3

3 years ago

2.0.0-alpha.4

3 years ago

0.3.0

3 years ago

2.0.0-alpha.6

3 years ago

0.2.0

3 years ago

2.0.0-alpha.2

3 years ago

0.3.1

3 years ago

0.1.5

3 years ago

2.0.0-alpha.0

3 years ago

2.0.0-alpha.1

3 years ago

0.1.4

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago