{"name":"@apollo/subgraph","version":"2.3.1","keywords":["graphql","federation","apollo","subgraph"],"author":{"name":"Apollo","email":"packages@apollographql.com"},"license":"MIT","_id":"@apollo/subgraph@2.3.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":"90cc816872c5ecd5308a91b9b1c7a5499aa8650f","tarball":"http://registry-npm.ywwl.com/@apollo/subgraph/download/@apollo/subgraph-2.3.1.tgz","fileCount":69,"integrity":"sha512-xn9SZm1sJNJLfyqtXV8ZxI0tQSsikkjExGCoEfXYqHINDucXRqHtPVlCv5G6k0xhrDQhmmzlvGMzsCuWsUAv4Q==","signatures":[{"sig":"MEYCIQCetQG9e3gekKuBsQ+vQaCqaDHyiZCGI/LYwYngb5DpjwIhAORO8CYgtSrb8u4x+HPMuKItAqXZkAtgbL8oPlT4UsuQ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":204734,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj4WYBACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp/Ng/+J/CQ9ZvD/tTQl2fybc7bLmYpLHjOw5fpg62GWCxcDYEncV/n\r\nC9dSQV4eZ871IJMwy2qr9+3lybZUR7MYkWm5H50bLyBbo8ISn9w9MsnJUOsh\r\nsIf+J98ezb1iTg6FSCWpiVWi9LX6NdjjSnw/AICdTkMJSluyijyW7ADOG1RE\r\nFu4YGlgXmre6xVm9KmIN+vfH1vGL1qARdQauzFTAR755k8Nwrmh0e/XbHQ3G\r\nUw0JUpwqk01HATmDI5chZsFjabeu8HZB7PGorhRxGl1Ps/BOV1Mj61GOx3fO\r\nTUt2C1RBJxS3iRafAnI8nHZUH9MgEJT4qKmVOwZPFomCfTy9WzjNVq8A8fQO\r\nFta2UwRnt456qLSROQDU4rXhaXE3E47NM2zdBw7HS6KfqPx4YkMXBFYRZriW\r\nUUMG0TZVhuImfBkenyEVTJ/ygiFFS8XyRzjAWdUl+KoUkikKElSv1A6AHkVf\r\nGfLAKZE/laiaNCL/keEzPSee63FzR2EUIy1v2//q6aUsRC05A76CK52bbfIS\r\niW+K0+8FnD0H04QFjZ6UVdCKberlUqIL/fQQw1GdILPB3ti9cZq8kbvb8B6n\r\nDmr+GewGIx84yNmDH5WWw0Mh25VQ+vjjLKMctvM7d/SmmyxCbX1Gasac2XKu\r\ni1sXutKFW+EF45r45aAtmEBlmBd2oOS86rE=\r\n=eUnc\r\n-----END PGP SIGNATURE-----\r\n","size":50180,"noattachment":false,"key":"/@apollo/subgraph/-/@apollo/subgraph-2.3.1.tgz"},"main":"dist/index.js","types":"dist/index.d.ts","engines":{"node":">=14.15.0"},"gitHead":"b025b0ba94142948ba3db033eac8adc3e5da29c7","_npmUser":{"name":"apollo-bot","email":"npm@apollographql.com"},"repository":{"url":"git+https://github.com/apollographql/federation.git","type":"git","directory":"subgraph-js/"},"_npmVersion":"8.19.3","description":"Apollo Subgraph Utilities","directories":{},"_nodeVersion":"16.19.0","dependencies":{"@apollo/cache-control-types":"^1.0.2","@apollo/federation-internals":"2.3.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"peerDependencies":{"graphql":"^16.5.0"},"_npmOperationalInternal":{"tmp":"tmp/subgraph_2.3.1_1675716097449_0.4353994950597444","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":1675716097580,"_cnpm_publish_time":1675716097580,"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"}}