{"name":"@apollo/subgraph","version":"2.0.0-preview.0","keywords":["graphql","federation","apollo","subgraph"],"author":{"name":"Apollo","email":"packages@apollographql.com"},"license":"MIT","_id":"@apollo/subgraph@2.0.0-preview.0","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":"3d1d49e32c151c97ee8f3f9bdc7fa7c0610e8451","tarball":"http://registry-npm.ywwl.com/@apollo/subgraph/download/@apollo/subgraph-2.0.0-preview.0.tgz","fileCount":68,"integrity":"sha512-y9uApYa5uvn36B8VxSV47zmyEUdJloAd5ZUcudWeXKP5mwWDoWBjFWRJ5o7WIpU30XF2nx5fmH43yIg7B4nQUw==","signatures":[{"sig":"MEUCIBSA5qS9IS3eUduWRjX5dy3aYEu2kxCFcXV5Acdng7a0AiEAy5yKIWro10DMqb+/xbEfq8q+QKurlTp/ldT0zjhQXNk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":222294,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiJ2QdACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrZnA/+N8QFHo1uyRaadTQttxH75H7rM3UlkRiFJb6/Nu+sY4p1FXNC\r\n9QebwP73V4EyR8JEo11lwLitBoJv7Ne4ScunzlpuM2psA+x9RU48jKyJXPpq\r\nrM8JZ+iD0vek+8s8UfC0FMSh/vfij5Z86+Zwy9mC4fJDMelEBpjuHMgLBsVk\r\nCraIJ0Rl8sX/JvCLo+ovCYET87n2C3WT1Hu4uNDywny+z3nVNii7pI3vXDem\r\nqseHSgCNvF2sbhgHJ+HhRQfRjomtU9AEySoHiBbiQ+5jsvOPbsjyTw0hzEvY\r\nFy9ZJ0+aZ6Ru2kVX9G5CEtKzxxBhcjSQNNq8U3TfzAIKQYI6OfTJYLl9vbA/\r\nZP57yzkF9i/CxXkN85SJHomSIIYToVmo3hZOt71ZrYVk6vCpZg/qMLqFvcoM\r\nJWwXckjwu5ttlICdB6M7UhBkgPmxnJfApUP2rPAq+TMT53qbc4OulaKV+2vk\r\nuvVg+23DU3L362Jgt5tkHZMLIMPNPu9AVI2DHecCfjV6JwBEUJl2HsWHy30J\r\niW+KrpQcDXR5MS7zGM4TQut12MdgsJUS6SL/WxKc634HZnQdXPQDTdZnz/c2\r\nLX8ywY7miFT5ht97arqpyhumFeWhMF13gOVbpaN2h0KMqq83BG6d5PsOUQhj\r\nAkfjHckqo9H/EYPZGPTaWw+Aa1Jp/Vjdaa0=\r\n=TdGM\r\n-----END PGP SIGNATURE-----\r\n","size":62276,"noattachment":false,"key":"/@apollo/subgraph/-/@apollo/subgraph-2.0.0-preview.0.tgz"},"main":"dist/index.js","types":"dist/index.d.ts","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\nconst { ApolloServer, gql } = require(\"apollo-server\");\nconst { buildSubgraphSchema } = require(\"@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\nserver.listen(4001).then(({ url }) => {\n    console.log(`🚀 Server ready at ${url}`);\n});\n```\n","engines":{"node":">=12.13.0 <17.0"},"gitHead":"e76fd3e16bf140ba9b30fe26d48657bccca180dc","_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","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","peerDependencies":{"graphql":"^16.0.0"},"_npmOperationalInternal":{"tmp":"tmp/subgraph_2.0.0-preview.0_1646748701449_0.6477272863990222","host":"s3://npm-registry-packages"},"publish_time":1646748701621,"_cnpm_publish_time":1646748701621,"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"}}