{"name":"@apollo/subgraph","version":"2.1.3","keywords":["graphql","federation","apollo","subgraph"],"author":{"name":"Apollo","email":"packages@apollographql.com"},"license":"MIT","_id":"@apollo/subgraph@2.1.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":"e4e9de30ef37df9458c44d1a3b21041bc62316d8","tarball":"http://registry-npm.ywwl.com/@apollo/subgraph/download/@apollo/subgraph-2.1.3.tgz","fileCount":70,"integrity":"sha512-PLAobTaoPEli0O/JCZTl6bCGHsbDoDYaoy08nTvaulaw1DuvOlUPicjuvjjGeO9xAhWK3jaRml1HGOCkK62eiw==","signatures":[{"sig":"MEYCIQDSKFo0pR6k3FrnonxPgMd7Vc8dpmXetCsFmZl56RMm+gIhAIEZ86Mldluwy482dZX8IHb08+rKMokizdQZSgPZqv+5","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":222260,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjLdnPACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrZHg/5AK9OXdmjL29RMan/B3YSfXFlHPpDWrfnY4NFwMAwfIr8Ge+D\r\nKQ+d0E9t6qE6hmQEJXSRWWR+iUM+My1bsKa4ldOZZKYBlBMFGX7kwFUWN8ei\r\nD2TKfKVstAxNjjZqRretVq4/0nY6SrLM04OhU538Tf7vksWWBr1kVW/7BM8f\r\nsQjLZJmCHa/wf2eBAKYyYH8KonCkmJ9AtGQ1eZs5bvRN09fM5w+n5WV5ytMG\r\nw9ULNHjBJNSw5iFFNgMnPw+UbFEoG4cCUkOh/8sEle65QZUQHvro5KzWe23m\r\n+Ifb34LookLuj7+kkesv4lIB9jgHqpvO7nw+CbLe3ezDYJz5iJcezwHUVNYa\r\nvBRoUmcdm8P7s/eSV2nAMHpXh2ejMw+IZo6UJy2OdiU49K9iF2jZGXYjxgvQ\r\nOyFOqvHtcyybtsdHkVThNZyYdVT81zUr4rFb8gRroa570tQ6UP09p+1DvL6U\r\nmr0xtYwaaZX9Od+JF74LUkbuJT2z4jgPDEtwL1DPpwTqcJjgYdfAN15M8c2E\r\nuOYVSTIILyw5pRlhpq683rYKgcVT3bzr6kWVCL1jdH3BjGM8oLl+e3dJY8Mv\r\nitR8EJGHWktfktOue5ODCRgHYHjq0Sb25C1gVRQ3hxcGE/jrR1To0z+lTEuS\r\nkXfEgouZxS1G41frFgb8X59m3YKbZjJAEKg=\r\n=25X9\r\n-----END PGP SIGNATURE-----\r\n","size":62727,"noattachment":false,"key":"/@apollo/subgraph/-/@apollo/subgraph-2.1.3.tgz"},"main":"dist/index.js","types":"dist/index.d.ts","engines":{"node":">=12.13.0"},"gitHead":"4b075b9fbe3629e09167b280b0005457ad0f593d","_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/cache-control-types":"^1.0.2","@apollo/federation-internals":"^2.1.3"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"peerDependencies":{"graphql":"^16.5.0"},"_npmOperationalInternal":{"tmp":"tmp/subgraph_2.1.3_1663949263564_0.8930710025286481","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":1663949263927,"_cnpm_publish_time":1663949263927,"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"}}