{"name":"@apollo/subgraph","version":"2.0.0-preview.9","keywords":["graphql","federation","apollo","subgraph"],"author":{"name":"Apollo","email":"packages@apollographql.com"},"license":"MIT","_id":"@apollo/subgraph@2.0.0-preview.9","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":"72da83c87ee330818dc3458bf5a4f8693cde5bd1","tarball":"http://registry-npm.ywwl.com/@apollo/subgraph/download/@apollo/subgraph-2.0.0-preview.9.tgz","fileCount":68,"integrity":"sha512-aG0s9KEWmIXMxVbosK9TVgYZIlqCVynrt5bLjbxHakEBoRT7fbwHCm9dkDcj2aX+O9tW0M410SwzlzMNMG/T6Q==","signatures":[{"sig":"MEUCIFP8kwHErECQoYC/K90lTflna0ayhEDtK0aJ6lwzAA1kAiEAtVQ/dbwfbT2OVgvNHkmvg7CdoqXHUEQRk3CQQdBYyp0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":226646,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiR2h9ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrQcQ//Zbw7C9Rr/0z+rZg5lZ+tCgfWnXJcm1trTvN3IfZk4WHxajA0\r\nVBUx4BlQ+v4J15/G0suRtI5XIZBXzAvYfKQ0m/hE/wu83oX4b9UNAIDgTzWD\r\nrci6V5OXRFSakU6J06APatvJXPbgPzwbeH+nqbJx5SdLeFdryIeepTqV8o4K\r\nlv04EUtkANq1fq/Pk0oiQmLhT8GylWcfhaGQ97HcXz6LwfyiF9z88lx23CTz\r\nMTprfYryGpV2hosDy4JCHDQwJdHxvvOwSf62NicOEHHJektnTu6tAy4oLSSa\r\nD9TcTb2fqbH9D6tXAjtuF/LR1lFFxFdrJCNcLI1xXRIz/BtYqmVD1bDtRZB+\r\nCGULs8OWlyqmhcTf/tJESIEAq8gRyknuqxwe949hSqwNBT/mVilJPC53tv3s\r\nNwNX0Mqiigdlcs3pNxNIDq6qmRcLESHSY+tcv9zoTpdr9k2IoHGmRqvxPZIq\r\ncwtmJ+sJsBs//1Pf9InzSg3Al6tI/nn8ays53vcqcYzNTeO9GXCStFqjmCPX\r\noW8+llVXC0GH3QqK+fTgiaPqfKi9n/Qe+0K8d23VwHmiF1B+RUyLIXcz8yTy\r\nhaWgaFVXCx6yx1KP01gTszUmMb66j4wLJfUbyB8Cfdw4oNccbbynNn2+EqMD\r\nQOlBk8SyC4kokjTGGNZHpLQCVzvd9mTMivg=\r\n=poLY\r\n-----END PGP SIGNATURE-----\r\n","size":63056,"noattachment":false,"key":"/@apollo/subgraph/-/@apollo/subgraph-2.0.0-preview.9.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 <18.0"},"gitHead":"dd5ea3a7675af3e19e82d8150f72fe217074ae02","_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.9_1648846973521_0.9477059310350895","host":"s3://npm-registry-packages"},"publish_time":1648846973658,"_cnpm_publish_time":1648846973658,"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"}}