{"name":"@apollo/subgraph","version":"2.3.2","keywords":["graphql","federation","apollo","subgraph"],"author":{"name":"Apollo","email":"packages@apollographql.com"},"license":"MIT","_id":"@apollo/subgraph@2.3.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":"f59ce196b2556a40e95e250e3357939153faa6e4","tarball":"http://registry-npm.ywwl.com/@apollo/subgraph/download/@apollo/subgraph-2.3.2.tgz","fileCount":69,"integrity":"sha512-PYSVD+tx49EVjII25Ip1QsrOCn/Bmh7KBqoqZsp/AT/8yGbqX5j9oAeRH37QcOxbl8TXBcJBDKbPO/KzUln1Dg==","signatures":[{"sig":"MEUCIQCrDGJcDz8ux5Hlpdo1NI3tr66tZzL1a4RcWDkNLCV56wIgRZVpKprWMsuclHC0goT/A44ExcUUtOM7skv8sB7sSoc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":205072,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj5mxSACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmroTQ//dvB6bA1+Eg51Py+UHcNRzmBkch9oJJWzwo14xrI8GWP02MAN\r\nxie5fNp8x0WORwZwF9T1hQgcSshZY1FcCia8RgijdfSExIsOrtbJjpKZZ/R/\r\nWP/I/iul1Tx6a5GknxQ/W1ICJLjZ69lku4FHCbC0MtSzJBwog+EpMhPa4nPi\r\n15ADbtN/mQB2EnVd6nGskybydBp++Xr5sD4f5vM1u8sUof3rlReGgq4nDfPA\r\nlu3zQZGd6tRiWUo23ns+e1faQH1hZgA7BCkWJAr6WaS0EqMUyRG5ybx8dHJj\r\np/k1kMWkskeU2JMaP2AQYqLYbHZNE3EAiu36NrnCNcQaeqEvYuytowJREU+U\r\nESy+s4SgX0fCnbsMJWHDLQtcsmaMazi4+926Ba2d+w+wse0Ka3Ug3H6iHs6I\r\n1bHQpnQ4nPeCSAy9YALqJk27cs3o93bQLps+WmtySW7juTEkDsE1WQS3jAeu\r\nCiIki6uxkRy5ya1ZT4p0e4I4cwB6jRTNA66+PFbv84Ryxip5v7T4giyeseUS\r\ndyvt3YEfQLeE/SrwE/57M8Q0K9Bu9r1fyJYZ2ME1hkOfIWDs5F+m7DbHJg/k\r\nnTWL3HPr4UDUch9zk90jYxeKLa8CHUXO0EjpyTT57Lc8tbRJ+4zbKG4PEcJ4\r\nf5W+Zdr2FV9M3Hx6CqJpDehId+EhrVxRUbA=\r\n=5OHb\r\n-----END PGP SIGNATURE-----\r\n","size":50266,"noattachment":false,"key":"/@apollo/subgraph/-/@apollo/subgraph-2.3.2.tgz"},"main":"dist/index.js","types":"dist/index.d.ts","engines":{"node":">=14.15.0"},"gitHead":"4f6d7bde74c537ea85d0a5435986bedf29a21e7f","_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.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"peerDependencies":{"graphql":"^16.5.0"},"_npmOperationalInternal":{"tmp":"tmp/subgraph_2.3.2_1676045394192_0.9495636864865495","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":1676045394347,"_cnpm_publish_time":1676045394347,"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"}}