{"name":"@apollo/subgraph","version":"2.0.1","keywords":["graphql","federation","apollo","subgraph"],"author":{"name":"Apollo","email":"packages@apollographql.com"},"license":"MIT","_id":"@apollo/subgraph@2.0.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":"ae638802c9841fc3189b9e8545a93bfab0378c90","tarball":"http://registry-npm.ywwl.com/@apollo/subgraph/download/@apollo/subgraph-2.0.1.tgz","fileCount":68,"integrity":"sha512-GHfJ+W7A2yiES+7nKlPFcjDuXFbj/hgGADVcNo+3HUSHOR8l+7gUhn/7pED0bhUPO5Dr2yEgz7aA39MiQ6PHTQ==","signatures":[{"sig":"MEQCIEgxfIJNUMa1s4marnJ3u0YDPMXEKthYwTGgu6gDGXq4AiBYg6Of6RN4QfOlaswo3auIGWmh6mJtBVYcN/vVHyua9Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":238426,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiVceJACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpzQQ/9EOdmX8yh+71beIpKRV7uRSmv6vZMGDXCJerDVShkDMDqbNYz\r\nrupFnjkFhA63NhNoSwC/26vIEhzZ5ueImRglBp6S/TvwEvByE44kxhzms+qC\r\neoML7vbxUpdSB4l+wx7YK1sXiaHU5KKLv83uIJKCTX+asTfGN7BlE8Z+9sbx\r\n8NFWACyB6gy5FYF8rtopE5Kd8pnfmQvu+I+9BjhL2AK1yg+hfy093ew6tkzq\r\nWQXxGsXyu+j0c67Cxd4L+OIx4EoXA5/HlB0liv5waYJAE+xuCEnLuzqKjosV\r\ngWpzpci4MKYjZSG9VtEFSnZLFf1LeXTgGfFWiFEkqk1r9BLEOVtjo1OMRm0o\r\n1IvSFs3Akd4R7Tn0cG/K5MzrBmU3W9L2tf8/KbZornxOp9bEGaLH8rmtIvT9\r\n8kgVChbu71VJ1FEkaH39ldqJP73xGYfQtdX6cUaT9NuK0ebi+VcRRRm8dnW+\r\nj/VTKRbgfJaLqxEaZFt+JWLkO2+fEd3giHSL9AZdkJydUknU6MHtUHpX6CWG\r\nxHmoEOCaesEJjffveFTd2unFNPH6NGlfXnUYQddLyvD80VhxHInIIGS00ceu\r\nHVgN1PWEMdJwQFr9P7l5Bq1NMY3DeLADtwLMRlCLj6G7/utzqvMxTAcV8S/g\r\nTt4Gq4AwmKf1YqG+18ffDdXCbzaPr09qPz4=\r\n=LO0F\r\n-----END PGP SIGNATURE-----\r\n","size":65385,"noattachment":false,"key":"/@apollo/subgraph/-/@apollo/subgraph-2.0.1.tgz"},"main":"dist/index.js","types":"dist/index.d.ts","engines":{"node":">=12.13.0 <18.0"},"gitHead":"e38b22c5796b052d1c373291fac93e0d72ee5ec1","_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.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"peerDependencies":{"graphql":"^16.0.0"},"_npmOperationalInternal":{"tmp":"tmp/subgraph_2.0.1_1649788809736_0.9641211607365379","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":1649788809876,"_cnpm_publish_time":1649788809876,"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"}}