{"name":"@apollo/subgraph","version":"2.1.0","keywords":["graphql","federation","apollo","subgraph"],"author":{"name":"Apollo","email":"packages@apollographql.com"},"license":"MIT","_id":"@apollo/subgraph@2.1.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":"538c0b14f84c913fbc930a6f37cd32d3c7c4dfd0","tarball":"http://registry-npm.ywwl.com/@apollo/subgraph/download/@apollo/subgraph-2.1.0.tgz","fileCount":70,"integrity":"sha512-sgbJAdMiFqCa1v6hRhW4MtMrPUSzilsPlC+wZBMYg6NA6wt/cGHIme1+5tiFGEPXTfy4xZSBrKY8nhGHjJY5/A==","signatures":[{"sig":"MEYCIQC+12UM/6fFxKrC3PzQM2ztYWmgJ3VdcIQWy8cwpZ6ZNQIhAJQeB7UnYhM2fquwKz54W8x0TAnfZBE0PyVW6ppQCEZH","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":220078,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjDQctACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq52xAAjdPvjF+Y2/5mZWwSBvLDLlmXL7pzoq2oFZ8QCLQl7hcLePo8\r\n9UaBRicyJp2ocHMwF8dexMrUaB8N4wo3EETQ8ydekALtU0Rs1xAhNR5MfhYY\r\nGbHCmNMcSve9KyvD0EH6H8KsJYrIIMYFDNBacN4qQH77RcjXdXsrS43QzdOu\r\n3dW1cWth37d+ogRPGN+hYfpKMwh4KswH7+3hc6ee53iJuV8qNXWpvkcKlFIl\r\nzDAYtvkHfADmEw9hn1ky5D1RJw/ucaNv9kCn29gPvgC2d6Z1WaccBQO1Cw42\r\nPzXFbYZjDhYHD8ijmp5fzdIVqP7d3F48Tv5VXhPpDep2o2htFjQBuuOHNbHJ\r\nAdy6uXwr5zhli+VXuVmlllYBSGe1zAatvOTgZNJQC4HmlFUSWvkOtDoH6pxb\r\neiLpTkEMFjx/M+upvFo9Q8J4oBaxzlmaQjoPaKuo8N4k56GYefZc6pQNEScW\r\nFI/qagt2VMcYfiBjtLAMyqJII57u9Ta9mHkdIIbSXMeMEZTSJOi2kgWht5v7\r\nBYTdqxdotShO0Zn4rNBOTW4wQiTDh2nBcWbHPpdo/6SzhYOz2zQcVxCEZzGU\r\nVr6ZHpO3GBrEN+x9uEvgDbvoI3Tx3zfx9sMlgIGSJ6k/O3n9Zitmy+J5FIKb\r\nqHNXBVm85AfR4rsnH4LnZwmuk9a9b57STIo=\r\n=jO+v\r\n-----END PGP SIGNATURE-----\r\n","size":62031,"noattachment":false,"key":"/@apollo/subgraph/-/@apollo/subgraph-2.1.0.tgz"},"main":"dist/index.js","types":"dist/index.d.ts","engines":{"node":">=12.13.0"},"gitHead":"6dec2f26af031434c56bea46a75330559dac5f5b","_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/cache-control-types":"^1.0.2","@apollo/federation-internals":"^2.1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"peerDependencies":{"graphql":"^16.5.0"},"_npmOperationalInternal":{"tmp":"tmp/subgraph_2.1.0_1661798188857_0.9035691806085822","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":1661798189163,"_cnpm_publish_time":1661798189163,"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"}}