{"name":"@apollo/subgraph","version":"2.3.0","keywords":["graphql","federation","apollo","subgraph"],"author":{"name":"Apollo","email":"packages@apollographql.com"},"license":"MIT","_id":"@apollo/subgraph@2.3.0","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":"2dc747c4bbfc3114060f7224683375154bd58607","tarball":"http://registry-npm.ywwl.com/@apollo/subgraph/download/@apollo/subgraph-2.3.0.tgz","fileCount":69,"integrity":"sha512-ryB1iVnnV6+xYVqryEU9ylWLpVuCkzIF0DwYpxBZqYAfRNIZHrpvou6o2k27xeJuMAh7pcDTmQW5PiCPAseubw==","signatures":[{"sig":"MEYCIQC4ZziIGIJkOQBjXG9MLWJgAZO7a1/Wng94OVWLj6qpZAIhAK4pujGoFL7z4RYWyFFDlDFX7GzC4IcEfeTsCKFN63iD","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":204649,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj0Wz6ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp0jg/9FmUCapZqvyMPznVQWaIDSw0HDhi8INoYqymXcxQBuZdG7lJ5\r\nbgoCn0Hr0PU4tiQnK1fyYZXx6odwSgU+5ftT+KhRu6z5JWHEQbtOwJ3MIeUw\r\n0ysmd4ibI1162UaWIcAXQ4j73ego0zFCQ/LajguoIt42P19YMxqkVkbN10HP\r\nffnQadJBGYJUg2pP5A6qhngXEbBObiq/7Tl4i3MNFFTN11oAPrAE99DfD32n\r\nqwP8CWS19VEhtPLaVFYY7Y5HVs3cvS/F+Sgp5XMhNSAUTHUdyAHLrAEGVXaJ\r\ntehV5yM9/7wh8NoYH9UmfYyIizKV0Cht3g2gNlEhLlzO/zdMj4LSukoFlKYc\r\nreKCLpbQBO1rDOrfpNkSQEYRT8TO2x2192+5Z6DxQQ2qscMkdvYywIiYd7z9\r\nYWvrc+jqyvTAqJcsNTFKR6BtWT59IOlo2iihyCqqozodyFRyfsMOVUW13FJ0\r\nRPnY4JNDykvscQz58dqDvfVq3qsvpPp7fRJrU5EMhzNTiCNtRy0yiu1MbGcg\r\n+APvpsl+IIY4BTG9pv6n5jOCCUZdP3PG94gHXZxc2TWdZ86QWmvCCO3VsX6q\r\nVgdWy3qedMkIj8SgJdTpimz9P++Hqg3kJWV92ss+UGpRdTdIgOHiEeRine35\r\nyJb90BfGrbKze4artQxDcsSG74M2LDwe/bQ=\r\n=q+me\r\n-----END PGP SIGNATURE-----\r\n","size":50149,"noattachment":false,"key":"/@apollo/subgraph/-/@apollo/subgraph-2.3.0.tgz"},"main":"dist/index.js","types":"dist/index.d.ts","engines":{"node":">=14.15.0"},"gitHead":"5beba1d374366cfc20cfe6f9ab653511b0588dde","_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.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"peerDependencies":{"graphql":"^16.5.0"},"_npmOperationalInternal":{"tmp":"tmp/subgraph_2.3.0_1674669305839_0.7344133934765782","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":1674669306012,"_cnpm_publish_time":1674669306012,"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"}}