{"name":"@apollo/subgraph","version":"2.3.4","keywords":["graphql","federation","apollo","subgraph"],"author":{"name":"Apollo","email":"packages@apollographql.com"},"license":"MIT","_id":"@apollo/subgraph@2.3.4","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":"48e776dd0063a2ed8a6b23c9cf7b9be58f799653","tarball":"http://registry-npm.ywwl.com/@apollo/subgraph/download/@apollo/subgraph-2.3.4.tgz","fileCount":69,"integrity":"sha512-/V3NPLjCM+saxxj0n0HxogXeEnE3MKaJiYSl5nV1C0SE2tk7U8n6cOUGa9ZLY2rnLzzIOHQrF/GGvm8fUMFzcw==","signatures":[{"sig":"MEQCIDoyYnCwqn2g2SHhwxkdY+k57k/xUM4eOxvDpTNIJSdVAiAdpkS564SXCDA/kXBuHe6dgU9CieOj6YBiJ2rAvW1eew==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":207609,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkC3tpACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoNEQ//SVAd57MZoZ/ZQRKRU+Zie/pmDlWcND+JRCET7o4a3uHXVPsl\r\nykDfa4m5nWlz/VH4GjXpMwI4uAzmrBy/1RQ4HcLm8qOWT99wgSbdq4YuwdzZ\r\nN1eoxemLLzK5YIYRZR6v0NrMd5Sx76y1DSIlQuPlcVyTtA8Lk858CjhnAqNz\r\n9ExGV4DgwrO2GhfHyNeYTGGMdhTXu11eCClWDPiPaOA+jSrN66zezgwXN54+\r\nvLQR/GZG8j7YCRBI4VxDwl2tdupFTfw2QN7EUTcvid6/9qkkV61hjmzS5xpP\r\npRT80T0uVtZg1VsGQ7nHiCW8v4Xag3oX6jdN3U0RsqZI0ab1XfS4jgr4eucb\r\nHNCJHytPldxOF/SXGZZaAFheEm3l0aH1czAtHgnQPtRztmylxf61Tum+kykh\r\nTmMOIxXTi3ktoq46eJjT+QRDfF+Xag2g97GRqsHiB0RYlCWoXDtIclWvwXbm\r\nVi+Jzv8EchqpklGUoLYI8tRgfpszK8I/S6Hjrm0A7ywpC0hyeNJYPkbSN9Rn\r\nH/yl7Ae1iVJjiMkQ/Jl3Udn7KfjDh+UgSrpJihnR+eRjUfRBEA9bicxfQ/D6\r\nhkaCKSTMQ2l+agv/+f4eJecBRK3FURuulorMBLM4qyQU0PbzFKJlsaTAk1gI\r\n+fnh2PRDhjF+lWWfWiqR/ahjP3ZrjzY20JU=\r\n=5G/8\r\n-----END PGP SIGNATURE-----\r\n","size":50868,"noattachment":false,"key":"/@apollo/subgraph/-/@apollo/subgraph-2.3.4.tgz"},"main":"dist/index.js","types":"dist/index.d.ts","engines":{"node":">=14.15.0"},"gitHead":"cf0e24d9c2139111c34f69c4b2108d199f96cdf7","_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.3.4"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"peerDependencies":{"graphql":"^16.5.0"},"_npmOperationalInternal":{"tmp":"tmp/subgraph_2.3.4_1678474088994_0.2799379431129856","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":1678474089225,"_cnpm_publish_time":1678474089225,"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"}}