{"name":"@apollo/subgraph","version":"2.4.3","keywords":["graphql","federation","apollo","subgraph"],"author":{"name":"Apollo","email":"packages@apollographql.com"},"license":"MIT","_id":"@apollo/subgraph@2.4.3","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":"c6328e66d71bfe2c182276db1040272c03abd4fb","tarball":"http://registry-npm.ywwl.com/@apollo/subgraph/download/@apollo/subgraph-2.4.3.tgz","fileCount":69,"integrity":"sha512-O/VqXLA+ut1yFVmCsgwusgqDczScc5zYrHSW64xBX5hJ5/ZsgrcrWlgaf3bo7JSHsVlabnYHfXBOS9hKYjUlOg==","signatures":[{"sig":"MEYCIQD6hCM5BSfiVF9B18j8KbBn+ikxQKHiy5yrwDD8ugGWvAIhAL/oGsUAZjUzilCptDGb3ZSXJ+qSsO1fka76rhbZNJhG","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":213606,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkU/s6ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmovrw/+NBDWhYRRixk+OseW4FeXtKQOwVjcYhSoQDGY3qsZi0nz+UXA\r\nL6sQXpBUPJgcSja14mpsJAbroiNsAyW38gloD8BCOx1FYYdGOuaeHsLnYkw3\r\nc6HcvzZHjSkg/vhSHifg0EwmnEqHt5BHQyzbnK60l5ih0IfesGshFhGiREzM\r\nthHD2hvvCfQ+qU+v11v0awcbjQkJSQtVx/pWad8wHT3sUILFLdY3a4TuNL3v\r\nCtuaph+pk8is8QqO5WCIJ7oxphrrB158w0OKVnhh/GhL4lgNO01rzEgVzocd\r\nQsiJ6RNVi8kbz7Z/PSEpSJDs+Gd0FQ1ueb6ZxeMOmK9MeY6HX/laC4Q5GSIz\r\nhM3Qe3KIaRBQCACMqLYg8KMYTvbYzAWzaVxJl9awqp0Ssg6SHjTUOQhSmGB/\r\nchMRwvj9nZAUlREuE8uXj+uAH1nB/ZI6Zw6ShKknrwHbV7p6ts8A88aSMHfh\r\no5CqdbXeAyResQ7ichpPcxOI0lYxDfTz7uEkb3JZpod/0+7Ca8GTTpoOgm/k\r\nF/hJYxXxjMURz7pIFrYxqIQZJsuL56HKlhRlbo9Dbz6+cwsop4ie8vWvxVxn\r\nCOUUolvKu+mvP0JG64mPSdXm5/iroPsA+Y+6cXIgPXYEjBQ46couE3uqx4Hp\r\n2KDruUzvOSlKH622IpfukJl2Wd5++HTxSRk=\r\n=Y+iN\r\n-----END PGP SIGNATURE-----\r\n","size":52494,"noattachment":false,"key":"/@apollo/subgraph/-/@apollo/subgraph-2.4.3.tgz"},"main":"dist/index.js","types":"dist/index.d.ts","engines":{"node":">=14.15.0"},"gitHead":"462e67067ebbd7b4ea38892e516e1d38f5bf7bdb","_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.4","description":"Apollo Subgraph Utilities","directories":{},"_nodeVersion":"16.20.0","dependencies":{"@apollo/cache-control-types":"^1.0.2","@apollo/federation-internals":"2.4.3"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"peerDependencies":{"graphql":"^16.5.0"},"_npmOperationalInternal":{"tmp":"tmp/subgraph_2.4.3_1683225402694_0.8432076970921998","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":1683225402916,"_cnpm_publish_time":1683225402916,"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"}}