Convert Swagger/OpenAPI schemas to executable GraphQL schemas with resolvers that make HTTP calls to existing REST endpoints.
Swagger-to-GraphQL is a library that converts Swagger/OpenAPI schemas into executable GraphQL schemas. It solves the problem of migrating from REST to GraphQL by automatically generating GraphQL resolvers that perform HTTP calls to existing REST endpoints, enabling teams to maintain both API styles with minimal effort.
Backend and full-stack developers working with existing REST APIs who want to expose a GraphQL layer without rewriting backend services, particularly in organizations transitioning to GraphQL incrementally.
Developers choose Swagger-to-GraphQL because it provides a zero-rewrite path to GraphQL adoption, full control over HTTP calls through customizable adapters, and support for both Swagger and OpenAPI 3 specifications with TypeScript readiness.
Swagger to GraphQL API adapter
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Generates GraphQL schemas directly from existing Swagger/OpenAPI specs, allowing teams to expose GraphQL without modifying REST services, as emphasized in the README's value proposition.
Enables developers to use their own HTTP client via the callBackend function, providing full control over authentication, caching, and headers, as shown in the node-fetch and request-promise examples.
Works with both Swagger (OpenAPI 2) and OpenAPI 3, covering a broad range of API documentation formats, which is a key feature highlighted in the README.
Includes TypeScript types for improved developer experience and type safety, making it easier to integrate into modern TypeScript projects.
Each GraphQL resolver makes a separate HTTP call, which can lead to n+1 query problems and increased latency without manual optimization, a trade-off inherent in REST-to-GraphQL bridging.
Implementing custom HTTP adapters for non-standard APIs or complex authentication requires significant development effort, as the README admits with examples needing full client setup.
Does not natively support GraphQL subscriptions or real-time updates, as it's tied to REST's request-response model, limiting advanced GraphQL use cases.