{"name":"@apollo/subgraph","version":"2.4.1","keywords":["graphql","federation","apollo","subgraph"],"author":{"name":"Apollo","email":"packages@apollographql.com"},"license":"MIT","_id":"@apollo/subgraph@2.4.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":"167496f40360ffa25df4769c06b85cec48fe0248","tarball":"http://registry-npm.ywwl.com/@apollo/subgraph/download/@apollo/subgraph-2.4.1.tgz","fileCount":69,"integrity":"sha512-z9o0qMHyxMjBvQzQvuNMuxvI0GTttdMr3p2tlJN2LdL792/ZhN6hhdBEaV+n6C2nZ4Dw+bV5jq5I+6fBlnmV3Q==","signatures":[{"sig":"MEYCIQCInPLR+zJCKon7OeLEVXarmPoDf0U/rJFu6Cp4lfszxAIhAMAbbKRr3PPzRE+Ok5ms4n62ABH2pYUhRdq3643qbHAN","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":209981,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkKyt/ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmogKg//Wp4qagProLLkfNMjFjJ54MdFGbC5yVn4s0JF6FnFYqoOTXLW\r\n0b05eWFj1h26FRmJ4kvYpn7Ae/cF2PiKgYDNRKcYozhJPlONx0OjOp7QeLZx\r\nN3N/2SU+nR/SLEOq1SWphlWCkWk+o63mHeR8WBky3/h4EQ/syELyrcAI/0J7\r\nh2uMX2YJxP0ZfmzFikTL2IVcJe2nzEokFE8X1bHKRhbWWvEygu3rVlfaD1gk\r\ncgA5OogJEZ/HAywfll9vieCzE5D09Qbhi7JEUVBcKuPXKQl8XpUEb6JFALHm\r\nIdLov1idWEr8cNTrMyH+DvOhpHYZSVc1QBn0Y6DIFFgjL0uAva/PLpIGr6Ap\r\nB2DpRTkBSkbiIObnwJ/4Cv7+sMlfQycCLA+0M0vo21Dne9yibWyGeyfbV7bw\r\nzFsu+Yhko+esTjUSf5TdliVbee3wzZmVF/dVIwDpGGDvuGcQtQlEAiLatJhc\r\n9ksPy5oV8c4RHFfI8Y9VcU6ivGEBotLFasBkqe5Mg+NZyzOJ0HC8RrT0MT7U\r\nnnWmKetuqpieFCOLY32vSPt6upSfpPSJ6jUux+/1ZIpCIJNp7bCbHXXrwP3q\r\nS9+jEO/8BcNcCjnrgm2E08AUktm0cXu/zp9PQmZuk2umue14s2hh+qzf6t6C\r\n3NHuK8cOs6zx4mYWaHreT+TkTB+Epe45G2c=\r\n=OXv8\r\n-----END PGP SIGNATURE-----\r\n","size":51581,"noattachment":false,"key":"/@apollo/subgraph/-/@apollo/subgraph-2.4.1.tgz"},"main":"dist/index.js","types":"dist/index.d.ts","engines":{"node":">=14.15.0"},"gitHead":"a45768bbbb134a7716c17ae6c82d161c5c3f514c","_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.1","dependencies":{"@apollo/cache-control-types":"^1.0.2","@apollo/federation-internals":"2.4.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"peerDependencies":{"graphql":"^16.5.0"},"_npmOperationalInternal":{"tmp":"tmp/subgraph_2.4.1_1680550782884_0.5576173482772098","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":1680550783100,"_cnpm_publish_time":1680550783100,"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"}}