{"name":"@apollo/subgraph","version":"2.1.1","keywords":["graphql","federation","apollo","subgraph"],"author":{"name":"Apollo","email":"packages@apollographql.com"},"license":"MIT","_id":"@apollo/subgraph@2.1.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":"7658584aa1993926d1a172cbe12e3d6ff0fa4ac7","tarball":"http://registry-npm.ywwl.com/@apollo/subgraph/download/@apollo/subgraph-2.1.1.tgz","fileCount":70,"integrity":"sha512-C9rh3WkdhJ3dkJhDRYQeDo0c9ogNIbtfmwZuqr2yK1sAFkA4NSnwD7nOcjg9j+I7m5Prv1bbyJPb3FGWkqbqKg==","signatures":[{"sig":"MEYCIQDdak7JpgjmsKizbbSRNp85wp6sTtXD2xOf04JOVhgRrwIhALC8uGqEsvXBQytpEDEFlNZN4uvqAuU4pJt5549fRvFE","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\nwsFzBAEBCAAGBQJjD4neACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo/Sg/+OH+DpVScpNLaD80AmIQVnnmMs5aKQzWDl0BDd5VrVfu89j4b\r\nb5OrkWsDMhH7qdph0PerCgD+WBwQEVq1y8vWnQ3S+piJ52CnHzf2eijzuKBt\r\nEj7E7FapbAaTSk2DW/bbHUGQ3+pwQk3IMJgxifxqyDN28tnjPHUIgYlIYGCl\r\n08sXXZ4cnYqshKADrtFskwhqiO4woD3buxIX0huoyU3DbCnMUn0ltupnzLBg\r\nSTKByMRnr20k1H//sgJm+Tdhqt5H0YEACF+fezl/eDpCE6AHzz8L02grXx9w\r\n9jBbeWRsblG3peaM1l5ldnDPhcRcH4CqJCL2A3FFZGYJYfyvpADa9XRNFUQN\r\nIVP3sXnRNKdfYwKFGqW2VFyrmnjfxyNM2kxPx1N3Wp1yv/vi+wkL9LDksNOp\r\nYrNAEBb8VhJeAKzTZEcN+wXyocYIZ9d94Lt3rLSVF1r3e7yfDyxRTU6VOaEz\r\nEwrjvxNSspJxqyTTSdKxJvRss+1x0T5lil+AKEVYceWLglk6No3E0fs+BUcq\r\nIeUqZCPvaLULyxdAUa+NOOaE/pElcKGUS5zr55zteL5wZOdcO07jF3HN/VeP\r\ntsFo+XcOlli6nGY1k7VcxTlNEWCRZtmQSU23BCJtMYJ2gXbEnUetT21e68Pd\r\nEVbf3IlfJrwwEiJLrAyM08zH6zrjcW1sW4k=\r\n=7muO\r\n-----END PGP SIGNATURE-----\r\n","size":62032,"noattachment":false,"key":"/@apollo/subgraph/-/@apollo/subgraph-2.1.1.tgz"},"main":"dist/index.js","types":"dist/index.d.ts","engines":{"node":">=12.13.0"},"gitHead":"838a8e4f6f2ce0167f4f928664f605845be315ac","_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.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"peerDependencies":{"graphql":"^16.5.0"},"_npmOperationalInternal":{"tmp":"tmp/subgraph_2.1.1_1661962718099_0.43478108985619457","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":1661962718323,"_cnpm_publish_time":1661962718323,"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"}}