{"name":"@apollo/subgraph","version":"2.0.5","keywords":["graphql","federation","apollo","subgraph"],"author":{"name":"Apollo","email":"packages@apollographql.com"},"license":"MIT","_id":"@apollo/subgraph@2.0.5","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":"79bd284da1b9ba1196e7de9973654c878f21ae88","tarball":"http://registry-npm.ywwl.com/@apollo/subgraph/download/@apollo/subgraph-2.0.5.tgz","fileCount":70,"integrity":"sha512-bnxxoYmlalYJ5wiE2iOYae6bc9fHKik0zOHGcfTLpIm/T3l+1J0Gj5QIVYOs7u/agduo3VGjm8MQbvrtNHJExg==","signatures":[{"sig":"MEUCIQDGJJH1l1huN/ViiiZyTlx2LsCohgdWpfyNbiE8FdMazQIgGk0pfMDh6D1wTBIrkSiu3fKStXeRFtvxp3VZQ1gD8J8=","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\nwsFzBAEBCAAGBQJin4K+ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpc+hAAjl+nRCJUctHN884c12z8ie10XC5wWPuF9T/nGE9J7KGTny5/\r\nZMu/YB193mQNOsTk4fKvyR67Kk44pXsfgZqvauKM6nABmU0VfiXo2oIro7Vz\r\n9LVYReou/aQXzElUHsRHXDArKmJDFvEwr7ZfjwNQkDYbNl1zBQ/YNG+krizv\r\nJYw1f6BjaxK4zjBHDS+CIY+YsM/uTXD924Cf6Kxjz0cvLPtwZ1cm3BsgvTpO\r\nT1P0kOR3n7+lJJbjM37ctnQWxjnX4ZUKzWBWo+1AZCWEOgHy+PllECHr6qKV\r\nDMHIvOrKTdo29N+J86M5HacWt4pZILk+FQJ/8W7wHuN4U/SipqyyPEJrcpfs\r\n1A81qaPsOcAtIOJXqHnGKbOCXYLiwcbuw7U42c7htTRA3Q+ZIKLhpbII8Pdr\r\nzLa9lGxDpXvEKNxKf1+eY0/lfNeHN0ZLKr9O1mv69Y8ot1Jb44/onq/WtT6D\r\nv+EHGr/1fX/Q2cfh2JaJ6tW2rB+tc6JHCiidwQoFDj5nP9F7vESvFjSARrow\r\nwPd26HMivKbuN+pZXU01f+rQB1Ov3mNocoDp1ISYIEOQ1+uqUdjiAhXz8wie\r\ny5qy7Dcn0LlFiSg/jwdEJIay483BhErxdzopcBrJAyw5X21/vfAZrTxUBwr9\r\nttgQSbmAbMiq1P9vpdRc4Zm5g8wOycs7I6E=\r\n=YJMq\r\n-----END PGP SIGNATURE-----\r\n","size":62013,"noattachment":false,"key":"/@apollo/subgraph/-/@apollo/subgraph-2.0.5.tgz"},"main":"dist/index.js","types":"dist/index.d.ts","engines":{"node":">=12.13.0 <18.0"},"gitHead":"2f4ea16ae208747be00bffd317cfd63850284ea5","_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.5"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"peerDependencies":{"graphql":"^16.0.0"},"_npmOperationalInternal":{"tmp":"tmp/subgraph_2.0.5_1654620861884_0.8299261501667483","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":1654620862061,"_cnpm_publish_time":1654620862061,"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"}}