{"name":"@apollo/subgraph","version":"2.1.2","keywords":["graphql","federation","apollo","subgraph"],"author":{"name":"Apollo","email":"packages@apollographql.com"},"license":"MIT","_id":"@apollo/subgraph@2.1.2","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":"6eba93fe0c6dd059ba7aed4dbf606c537a995de2","tarball":"http://registry-npm.ywwl.com/@apollo/subgraph/download/@apollo/subgraph-2.1.2.tgz","fileCount":70,"integrity":"sha512-NGeiaaOVkDBc5P3GgdpOFHncB9b21mDg2NobZ1a1WkakT99XoE/D3czTux7Dzkqj4FjYHS/oiy9ghdy5/oEdkg==","signatures":[{"sig":"MEQCIA+k17p8xXVvlfUXgKP6DNkz7toRQmkQMbF4FVeTHlWRAiAmQNe4vz30vr/KCMTXNzG9q8sJoHTYkVlX0T2hA4WXjg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":222260,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjKy1tACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqTAA//dPYyOxB6wpmekbgY/rqx2nlvU74+3sbFyB2enKR+/Sr4Q1lS\r\nwhkUWR7rwLXVe1/AQf31gn0Hkjgj7g6/ZWRyuSGZ/yygdrGjNhmCHBLkltlK\r\nqdcrSnun0igEh7aAJaRAOFIRwl+qMmL2oKxaSZmJ2Xq0FGMP5/qFISOj12rf\r\nwl0Z6YDvxa5EQJO7rZzQj1gnsH+45bZuX3ghG8RWIzuxjJ1PIRPkqxpQxtcm\r\nG7uNlEMmx3DkgwYlDmt93aBpXAIZz3xm0EG3Dkyu6yIh8wMJXyZmti2B+zIq\r\nQigc58wfpLsZznDestJz74VjrWIhJ6jidTRqib5LHVEzdf075sUUjUA4Q3cp\r\n/6ihdq5hady62Y4rJApvtaRDToEsekAaWYayQlmoL+R+6Em3pCqGEsTLP/v2\r\n8WNo2zVvRRrt7evTwCIG7hZQr1UQ6EXMtwzd9QnzLeT0/TOPdU+wqkrgQejB\r\n+kDNcW6lQoTS3JaHgLjBALPOODjkrJpRX9zIgEu2M8k6sZutkesakkE9CPmI\r\ns5fHR6Y5j2PnNNLGleEdf+mbx8lcoFR7lw0z6qoEt0pmpbA6plgm/bh06d/j\r\nGAgdqEWwRngp9rsNND3LbPebSyaHZg56bHcwMKfWa8uaR75MbrntRmYh0Lai\r\nh4Aa0XkNvy+PXexlqvTesXtfs/SZ2v1jx6Y=\r\n=FkVq\r\n-----END PGP SIGNATURE-----\r\n","size":62726,"noattachment":false,"key":"/@apollo/subgraph/-/@apollo/subgraph-2.1.2.tgz"},"main":"dist/index.js","types":"dist/index.d.ts","engines":{"node":">=12.13.0"},"gitHead":"e693367401f172eb68f4dda9d3789707a67f7f15","_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.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"peerDependencies":{"graphql":"^16.5.0"},"_npmOperationalInternal":{"tmp":"tmp/subgraph_2.1.2_1663774061447_0.8215343236974331","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":1663774061710,"_cnpm_publish_time":1663774061710,"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"}}