{"name":"@apollo/subgraph","version":"2.0.0-alpha.1","keywords":["graphql","federation","apollo","subgraph"],"author":{"name":"Apollo","email":"packages@apollographql.com"},"license":"MIT","_id":"@apollo/subgraph@2.0.0-alpha.1","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":"87ee2f434bda5d20fd4a8201c17932808d11deba","tarball":"http://registry-npm.ywwl.com/@apollo/subgraph/download/@apollo/subgraph-2.0.0-alpha.1.tgz","fileCount":43,"integrity":"sha512-mWm22yUxhIpa9WJZ67+SDCOo8Lc8zLP4bKy9vjo+gms3lgppIgFkciY+dzfacq0eTBuMEhuEEg4BpTZauJYqGw==","signatures":[{"sig":"MEYCIQDSgiZ/ddhHLsBNsWPZRbg6wyWzxSTAa51zEGIkEmVnlwIhANwZj3TSd4WHsgR0ulz65xKW2dnXsLvn6/RyYrJzIW1v","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":171850,"size":50360,"noattachment":false,"key":"/@apollo/subgraph/-/@apollo/subgraph-2.0.0-alpha.1.tgz"},"main":"dist/index.js","types":"dist/index.d.ts","readme":"# `Apollo Subgraph Utilities`\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/apollo-server/tree/main/packages/apollo-gateway).\n\nFor complete documentation, see the [Apollo Subgraph API reference](https://www.apollographql.com/docs/apollo-server/api/apollo-subgraph/).\n\n## Usage\n\n```js\nconst { ApolloServer, gql } = require(\"apollo-server\");\nconst { buildSubgraphSchema } = require(\"@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","engines":{"node":">=12.13.0 <17.0"},"gitHead":"5f7184829607024343fb8b8ad0ac4e122407cd3a","_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@v14.17.3+x64 (linux)","description":"Apollo Subgraph Utilities","directories":{},"_nodeVersion":"14.17.3","dependencies":{"apollo-graphql":"^0.9.4"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","peerDependencies":{"graphql":"^15.5.3"},"_npmOperationalInternal":{"tmp":"tmp/subgraph_2.0.0-alpha.1_1635932362635_0.5841652858954107","host":"s3://npm-registry-packages"},"publish_time":1635932362802,"_cnpm_publish_time":1635932362802,"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"}}