{"name":"@apollo/subgraph","version":"2.0.0-preview.2","keywords":["graphql","federation","apollo","subgraph"],"author":{"name":"Apollo","email":"packages@apollographql.com"},"license":"MIT","_id":"@apollo/subgraph@2.0.0-preview.2","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":"fe6c44c67ab4bab76193d361a4e2931d9af7f0a1","tarball":"http://registry-npm.ywwl.com/@apollo/subgraph/download/@apollo/subgraph-2.0.0-preview.2.tgz","fileCount":68,"integrity":"sha512-Zer2stOocF5FSEDL6B0Rsmc6dFBEP5xuEgzScPSlg/C7e9kQPYCjjEUPBWGnNGuYCwH+AblefPayJ+/xBPoFKA==","signatures":[{"sig":"MEUCIQDB7PwMMNAi6AfKVydBcA+i6QxSQbDFH6Z+JBbF3uwnsQIgYc2Qd8PLSC0+wJurK+WFwqcBdV2YNBFcj23CLLFdxis=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":222547,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiKS54ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq0XA//a7gDx9w3JKhDEhSEu4QzzmiTTWgF0GAbpqA1A/9nviVAXNx3\r\nuE0GWHT2wiwbNPgP12NZ3SoJS/yMXZnGbpbIil/HCydFGo1D14bNFKDmf/BV\r\nOFgUy2AfZZQptAN/39LKA3xfJfXGWbhywW0qfEP99yClBWhcngXvq2LYjy6O\r\n0EsHFwah6UpYnOHxeFEJDr9ga87obPd0bwp/QY718zqpwE6FMBhmXmI37Obc\r\nl6TS3gfTNUF2RED6xc2XJbMVCW+PfE92DewRrkfWqxMmdubp6ms7pzDj2VqM\r\nK1xY4cp7GOdRgmnCs1qG6rpwx+FgCOPY/8Pyei31oAWUGO18jqt06IR3YSUy\r\nG2Av49pISz/dIo7srBoLiGbGOa+85thoGyVRmRkkQwohcWBhr4tMgs0ckNBm\r\nN3/cc4LAVtxEVNLavgd36ck0Ol1sAihxYc62LERLfmqQewK304p7gRhKLRGi\r\nuEI2KceBJNgm0X3jVl40KrNnS02qEWQV0PYRb6l3sWfk6gqEY/o5x7OJmOj4\r\nqIxA2XN9jiXYfcX3JSgiX3NJOELac2zY4KCtaC9KCAH8HarLxrMvg4xLTRE/\r\nAmO2LW8hoXrDkndbjyY1msJm9nBgFR1ALts73MgIVYvUu98bOBdIi7o3yGlE\r\nL/pq50uEfbIMzzqNX66Y5UYWmnWAiCVNq+w=\r\n=Fouu\r\n-----END PGP SIGNATURE-----\r\n","size":62362,"noattachment":false,"key":"/@apollo/subgraph/-/@apollo/subgraph-2.0.0-preview.2.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":"1d4b3ea02bffa29541c817df695a35e9691e615f","_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.2_1646866040760_0.5910108439524902","host":"s3://npm-registry-packages"},"publish_time":1646866040947,"_cnpm_publish_time":1646866040947,"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"}}