{"name":"@apollo/subgraph","version":"2.0.0-preview.1","keywords":["graphql","federation","apollo","subgraph"],"author":{"name":"Apollo","email":"packages@apollographql.com"},"license":"MIT","_id":"@apollo/subgraph@2.0.0-preview.1","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":"abd6fc248e6af9cd294ff32f748381caea672ba6","tarball":"http://registry-npm.ywwl.com/@apollo/subgraph/download/@apollo/subgraph-2.0.0-preview.1.tgz","fileCount":68,"integrity":"sha512-KnWeChvXYhTCcOHgdjZNlFMNSWwFEJ1WRadJpOClI3WW4sxmHWCOdkgGLBBoN5P/2/HuPuN2ZJVtpkb2bhLfoA==","signatures":[{"sig":"MEUCICId4cDFhzZYRUy4xmlx/S+Ck2mIIoeFVjxOy2W37DDSAiEAoRFXcdLlpjVc+anrul25xDiV6a60Ocy8ZcD8oKRXXK8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":219965,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiKOuGACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp8+BAAmR1sWhO4PhC403+EbbxhkRXxKsMTYtUTEPLs4B7wPeAJCW8a\r\nVFYLayQJ6v2fT7XuN8ODxDXrM8aPnLGJs8ePFCBgXgBjgSWnRrfHxnG0zMtF\r\nvMbUPJjV3qWxYkrTQ96OFznJmDcnadqlQUucOO8Hc/Rn1+7rUBHbn9P3kbpP\r\n4t2WHCU4Y+sI8xL9m0nzP5nyInDP6GWtCdFL06RU0tprW3/3O2egjpJtAsq7\r\nrelv0UDITZxGoCmxFhpfpQyZNukFk+AL30HvO/719J+dTjxBw9HgqJM+ZWQv\r\nt5p5w+FhWamjC7MSV0MN0CTCpydfWvi9lDSJUFGEX2OghLSS4xVNTHoLMjq8\r\n8/kSUiPEm4EEFrEPnBxXSu37LgE6sSVZMXOq5E+pbPx6GAL3nBncpPBhK6WF\r\nittIL3vMbdHnEpBsUDONzmmv9uINLW2stc9V/v9+RFy6GZmzd6etxUR2pzjA\r\nOKeqvdaN3T/s/AqRpe4qGBIVuJW58Uyae1VSMfP9zJNrRwTxdZ2yAVE1kf43\r\ndJcAx0kcO8QMpZRFO1Luc0L8OQ97AVq1N1lgpT1Bw6yO9o3QftJ3QNhV5kvz\r\nVebLal+GSQhrUYohbOqlxgfBUDQGMsQELSAlm90OFZsqBpblzaKtmDGh09XU\r\n2Jnf8Nzj4czJUCdst1M89zCS1Ua35w6/pe8=\r\n=0kPg\r\n-----END PGP SIGNATURE-----\r\n","size":61696,"noattachment":false,"key":"/@apollo/subgraph/-/@apollo/subgraph-2.0.0-preview.1.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":"0ab9894af98cc2687fe261ce415f19df0380a399","_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@v14.17.3+x64 (linux)","description":"Apollo Subgraph Utilities","directories":{},"_nodeVersion":"14.17.3","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","peerDependencies":{"graphql":"^16.0.0"},"_npmOperationalInternal":{"tmp":"tmp/subgraph_2.0.0-preview.1_1646848902570_0.4887577583489049","host":"s3://npm-registry-packages"},"publish_time":1646848902757,"_cnpm_publish_time":1646848902757,"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"}}