{"name":"@apollo/subgraph","version":"2.0.4","keywords":["graphql","federation","apollo","subgraph"],"author":{"name":"Apollo","email":"packages@apollographql.com"},"license":"MIT","_id":"@apollo/subgraph@2.0.4","maintainers":[{"name":"apollo-bot","email":"npm@apollographql.com"}],"homepage":"https://github.com/apollographql/federation#readme","bugs":{"url":"https://github.com/apollographql/federation/issues"},"dist":{"shasum":"4f704153a0c2706122995d258422b60070e66488","tarball":"http://registry-npm.ywwl.com/@apollo/subgraph/download/@apollo/subgraph-2.0.4.tgz","fileCount":70,"integrity":"sha512-Cx0SLIXyx358Lw+IQx5oPiVKNUKQOIvKFcDkII8cV+PtUVxVEDdMMjNqGm01nuzvpw2CFpI2FjTw3f5LNa2vvA==","signatures":[{"sig":"MEUCIQCk5tGUxLbCWuRjCDCeYEuUN6Pk/7npzVLwnrkZ0Fa/fgIgdBTfNItBLqXTt9xPlKcCju561JwfvAK4NUV280nnuj4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":220173,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJil4PwACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqnSg//eOwgn9gPiNqw/iI8v1SijGJrE+Uar3DSsjikIjCcy0XVVtz1\r\n647ZtiOUDMZM8axEyubhKNlQgcTibp+EiODkLQJC9NsV6ISWWKXQg3nVcTbj\r\np34oK0CQfoNJ71uwB0CuF/cVYNKPQGEzjv86pv1A508tgo8jfviN+L8A6BJi\r\numfgXgcMPOsqG5yOyGKlVqw/ejRlbcRcJQCbn4ttp6pFc9ghFu1TIHI7HPFw\r\nNDwHuygVyfdTDB6UJyIErsxRgPCzVwIeIBN1os6B91/bnwmmwTE9mT4X+qFc\r\nZaX9Xz4CcDglbMPj3mhDIN61aJeUoLH2XS+R317h7QwD7ZS50/k0C2/dzM87\r\nlbJOPiiA+IbN0l/XN3B0P0GGy6WutZeDQjMP+ikT2AnJAzSWvQMse1GRRHGO\r\noztKHdmzZDe4VXZUV2RgqY0o8qdxJMfO/85JJK3Th+JDA3x+7QYDZAvlLXrT\r\nLz7WbkEeygLwS8lXPQkyIbbngyH+NA11YePuNQHVGW0YCutOoI2L8v9oziYe\r\nvZx5ywyZuA1zFtbymbagKy9a1/TcgGFmENjqv4vcRix5qerHkBzTUC/ygwAD\r\nQxJmofSge79cXZKmhK/rO+3Mlpkk7d0XrY6+CXJnFn3441xzjZLsaPxwFXR1\r\nLEO5aL3efBZSsAQDwI+uIhi91yIhQ9kPtAk=\r\n=8QLh\r\n-----END PGP SIGNATURE-----\r\n","size":62017,"noattachment":false,"key":"/@apollo/subgraph/-/@apollo/subgraph-2.0.4.tgz"},"main":"dist/index.js","types":"dist/index.d.ts","engines":{"node":">=12.13.0 <18.0"},"gitHead":"5669891df48cc29df79c5ddbc06b0ff8378f30c5","_npmUser":{"name":"apollo-bot","email":"npm@apollographql.com"},"repository":{"url":"git+https://github.com/apollographql/federation.git","type":"git","directory":"subgraph-js/"},"_npmVersion":"lerna/4.0.0/node@v12.22.7+x64 (linux)","description":"Apollo Subgraph Utilities","directories":{},"_nodeVersion":"12.22.7","dependencies":{"@apollo/federation-internals":"^2.0.4"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"peerDependencies":{"graphql":"^16.0.0"},"_npmOperationalInternal":{"tmp":"tmp/subgraph_2.0.4_1654096880659_0.5422981971737237","host":"s3://npm-registry-packages"},"readme":"# `Apollo Subgraph`\n\nThis package provides utilities for creating GraphQL microservices, which can be combined into a single endpoint through tools like [Apollo Gateway](https://github.com/apollographql/federation/tree/main/gateway-js).\n\nFor complete documentation, see the [Apollo Subgraph API reference](https://www.apollographql.com/docs/federation/subgraphs/).\n\n## Usage\n\n```js\nimport { ApolloServer } from '@apollo/server';\nimport { startStandaloneServer } from '@apollo/server/standalone';\nimport { gql } from 'graphql-tag';\nimport { buildSubgraphSchema } from '@apollo/subgraph';\n\nconst typeDefs = gql`\n  type Query {\n    me: User\n  }\n\n  type User @key(fields: \"id\") {\n    id: ID!\n    username: String\n  }\n`;\n\nconst resolvers = {\n  Query: {\n    me() {\n      return { id: \"1\", username: \"@ava\" }\n    }\n  },\n  User: {\n    __resolveReference(user, { fetchUserById }){\n      return fetchUserById(user.id)\n    }\n  }\n};\n\nconst server = new ApolloServer({\n  schema: buildSubgraphSchema([{ typeDefs, resolvers }])\n});\n\n// Note the top-level await!\nconst { url } = await startStandaloneServer(server);\nconsole.log(`🚀  Server ready at ${url}`);\n```\n","publish_time":1654096880824,"_cnpm_publish_time":1654096880824,"dist-tags":{"alpha":"2.10.0-alpha.4","beta":"2.9.0-beta.0","connectors":"2.9.0-connectors.9","latest":"2.10.0","latest-1":"0.6.1","next":"2.11.0-preview.0","preview":"2.11.0-preview.0","testing":"2.7.4-testing.1"}}