{"name":"@apollo/subgraph","version":"2.0.2","keywords":["graphql","federation","apollo","subgraph"],"author":{"name":"Apollo","email":"packages@apollographql.com"},"license":"MIT","_id":"@apollo/subgraph@2.0.2","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":"b48cb89191ea112f18c591163a66c2f0bd3efde4","tarball":"http://registry-npm.ywwl.com/@apollo/subgraph/download/@apollo/subgraph-2.0.2.tgz","fileCount":68,"integrity":"sha512-44W6nWN4XTEkRYqDOSqJIH63ZIWRjxfoIeP592R9aCY8rBXKjmSWNKDsGO+fsi8/fhI9plvADDkNqNprJCJLOw==","signatures":[{"sig":"MEUCIQCmchb79u7yd8XKItEdCI/I7D9R2zINYAoVlEwHGx17TwIgfgTHatqqVBJdUS9HS/P1V9yZAqlWPyujG1beWNXH5Qo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":242157,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJicWtMACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq7iQ/+Lt+j/ePIeLBgj9nXnl/NMUg/569M1TeGVa8S2ezuG+8krP3E\r\nxwI4n7UeePkms+XxcyAr9W0kdFxuCqeRdGoVh34UA702Cr+prs/Ujn6y7Drl\r\nMcOq2cS9CVpkj4acN4DaLJJ1Vv/U0QrM6riDBg/g8bCBjjsvcuCgLw0a7Vbs\r\n5IpCWsSwU8galFEEKheOrig8DFlRf3ISSQVXpTxpmmrqVYmP9k3+1gA7pp7d\r\nDpHNpT0QWHVJyx3pb5RQiEG8rsDphMMWasZjoyzRq640ngIWhX1Er8dzjg7Q\r\nRprnrf56wW7QYksudc1zDIRbXapD3v2UvV41pMvdPKvTd7xBeMR+rKaDGKUm\r\nFEDxKQOQkVmSZmeHhUAuvYj/nADrAFTrz2iMFjb5a4BklK3ZiQxUP/iQYo2U\r\nF44UjjqB/1+6ei82sVGwZsvpkjjxOxLuvtphRak64uSXczOkT7NMm5SQp2Ct\r\nN7R19MmInkemVXngs3n5ROUTZPdmUzPWd8hpFhGlv6DUxBFMLKhCaV4jB4h/\r\n0nwbTkx8WTkqXX/0lCq2l0AcDmqxhpsAcWtC/chiedLgKz8GKS5v/1lr9/IJ\r\n0f/+Amp3o+JpmM3p2yzqyLs3r0YPOmu6ROZqTzEO/KTAGuwMfNhtXKMC/Pjj\r\nfFj0RVgBnSsWVLLDFx5KLtlWFiFxao/FF/8=\r\n=cgXv\r\n-----END PGP SIGNATURE-----\r\n","size":65961,"noattachment":false,"key":"/@apollo/subgraph/-/@apollo/subgraph-2.0.2.tgz"},"main":"dist/index.js","types":"dist/index.d.ts","engines":{"node":">=12.13.0 <18.0"},"gitHead":"02bd93d0ed4f75f9cd59b84ddcb66a30babb1553","_npmUser":{"name":"apollo-bot","email":"npm@apollographql.com"},"repository":{"url":"git+https://github.com/apollographql/federation.git","type":"git","directory":"subgraph-js/"},"_npmVersion":"lerna/4.0.0/node@v12.22.7+x64 (linux)","description":"Apollo Subgraph Utilities","directories":{},"_nodeVersion":"12.22.7","dependencies":{"@apollo/federation-internals":"^2.0.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"peerDependencies":{"graphql":"^16.0.0"},"_npmOperationalInternal":{"tmp":"tmp/subgraph_2.0.2_1651600204412_0.4774798323935141","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":1651600204576,"_cnpm_publish_time":1651600204576,"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"}}