{"_id":"@ajax.xhr/graphql-rest-bridging-toolkit","name":"@ajax.xhr/graphql-rest-bridging-toolkit","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@ajax.xhr/graphql-rest-bridging-toolkit","version":"0.1.0","description":"A toolkit to generate REST APIs from GraphQL schemas and GraphQL schemas from REST/OpenAPI definitions.","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"build":"tsc","test":"jest --runInBand","prepare":"npm run build","lint":"eslint . --ext .ts","dev":"tsc --watch"},"bin":{"graphql-rest-bridging-toolkit":"dist/cli.js"},"keywords":["graphql","rest","openapi","swagger","express","fastify","generator","api","bridge"],"author":{"name":"ajax.xhr"},"license":"MIT","dependencies":{"express":"^4.18.3","graphql":"^16.8.0","yaml":"^2.3.1"},"devDependencies":{"@types/express":"^4.17.17","@types/jest":"^29.5.3","@types/node":"^20.14.2","@types/supertest":"^2.0.14","@typescript-eslint/eslint-plugin":"^7.0.0","@typescript-eslint/parser":"^7.0.0","eslint":"^8.57.0","jest":"^29.7.0","supertest":"^6.3.4","ts-jest":"^29.1.0","typescript":"^5.6.2"},"_id":"@ajax.xhr/graphql-rest-bridging-toolkit@0.1.0","_nodeVersion":"24.18.0","_npmVersion":"11.16.0","dist":{"integrity":"sha512-/uUvJB/gcfV9RK0Zzif1AXqzKvMMJWUOA1fSc3jqDolwH7nzhNUR+8rjx37uglleXmfWvYuKmkgO8muyUOUa8Q==","shasum":"3fc56bbb3eab868efd93a6d2c0ef1e91ae22e7e0","tarball":"https://registry.npmjs.org/@ajax.xhr/graphql-rest-bridging-toolkit/-/graphql-rest-bridging-toolkit-0.1.0.tgz","fileCount":14,"unpackedSize":31309,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCMMAjdOPZa4qoXx49jaRZ91AQdMSVOzw89XdsocG4mpwIhAJ44JcRuKWZnxMYI0hOjUAJfIsjIYo7Oquvz/4AhD15t"}]},"_npmUser":{"name":"ajax.xhr","email":"yogeshmali752@gmail.com"},"directories":{},"maintainers":[{"name":"ajax.xhr","email":"yogeshmali752@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/graphql-rest-bridging-toolkit_0.1.0_1786308390650_0.738866969402157"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-09T20:46:30.471Z","0.1.0":"2026-08-09T20:46:30.806Z","modified":"2026-08-09T20:46:31.006Z"},"maintainers":[{"name":"ajax.xhr","email":"yogeshmali752@gmail.com"}],"description":"A toolkit to generate REST APIs from GraphQL schemas and GraphQL schemas from REST/OpenAPI definitions.","keywords":["graphql","rest","openapi","swagger","express","fastify","generator","api","bridge"],"author":{"name":"ajax.xhr"},"license":"MIT","readme":"# @ajax.xhr/graphql-rest-bridging-toolkit\r\n\r\nA toolkit to generate REST endpoints from GraphQL schemas and GraphQL schemas from REST/OpenAPI definitions.\r\n\r\n## Features\r\n\r\n- GraphQL-to-REST route generation from a GraphQL schema\r\n- Manifest-driven route configuration\r\n- Express middleware support\r\n- CLI to run a server from schema + manifest\r\n\r\n## Installation\r\n\r\n```bash\r\nnpm install @ajax.xhr/graphql-rest-bridging-toolkit\r\n```\r\n\r\n## Quick start\r\n\r\n1. Create a GraphQL schema file `schema.graphql`\r\n\r\n```graphql\r\ntype Query {\r\n  hello(name: String): String\r\n}\r\n```\r\n\r\n2. Create a manifest file `manifest.json` or `manifest.yaml`\r\n\r\nJSON example:\r\n\r\n```json\r\n{\r\n  \"routes\": [\r\n    {\r\n      \"route\": \"/hello\",\r\n      \"method\": \"get\",\r\n      \"field\": \"hello\",\r\n      \"operation\": \"query\",\r\n      \"params\": {\r\n        \"name\": \"query.name\"\r\n      }\r\n    }\r\n  ]\r\n}\r\n```\r\n\r\nYAML example:\r\n\r\n```yaml\r\nroutes:\r\n  - route: /hello\r\n    method: get\r\n    field: hello\r\n    operation: query\r\n    params:\r\n      name: query.name\r\n```\r\n\r\n3. Run the CLI\r\n\r\n```bash\r\nnpx graphql-rest-bridging-toolkit schema.graphql manifest.yaml 4000\r\n```\r\n\r\n4. Call the REST endpoint\r\n\r\n```bash\r\ncurl \"http://localhost:4000/hello?name=world\"\r\n```\r\n\r\n## Usage\r\n\r\n```ts\r\nimport express from 'express';\r\nimport { buildSchema } from 'graphql';\r\nimport { generateREST, loadManifest, createServerWithRoutes } from '@ajax.xhr/graphql-rest-bridging-toolkit';\r\n\r\nconst schema = buildSchema(`\r\n  type Query {\r\n    hello(name: String): String\r\n  }\r\n`);\r\n\r\nconst manifest = loadManifest('./manifest.json');\r\nconst app = express();\r\napp.use(express.json());\r\napp.use(generateREST({ schema, manifest }));\r\n```\r\n\r\n## Testing\r\n\r\nThis package uses TypeScript for type-checking and build verification.\r\n\r\n```bash\r\nnpm install\r\nnpm run build\r\n```\r\n\r\nA basic runtime test is included in `src/test.ts` and is built into `dist/test.js`.\r\n\r\n```bash\r\nnpm run test\r\n```\r\n\r\n## Example files\r\n\r\nA sample GraphQL schema and route manifest are included for quick local testing.\r\n\r\n```bash\r\nnpx graphql-rest-bridging-toolkit schema.graphql manifest.json 4000\r\n```\r\n\r\nThen open `http://localhost:4000/hello?name=world`.\r\n\r\n## Publish\r\n\r\n1. Login to npm: `npm login`\r\n2. Publish scoped package: `npm publish --access public`\r\n\r\n## License\r\n\r\nMIT\r\n","readmeFilename":"README.md","_rev":"1-578c72b5dbba407eae2fc17fb2828036"}