Convert a GraphQL schema into REST API endpoints automatically. Current stable version is 0.18.10, released as a mature library under the GraphQL Hive organization. It generates RESTful routes from GraphQL queries, mutations, and subscriptions, supporting nested models with ID-based linking and customization of HTTP methods, paths, and status codes. Differentiators: no framework dependency, extensible with custom context and ignored fields, and built-in model resource pattern for nested data.
npm install sofa-apiNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates an Express app with Sofa middleware that exposes GraphQL queries as REST endpoints.
Upgrade GraphQL.js to v15 or v16.
Change import to named import: import { useSofa } from 'sofa-api'.Ensure models have 'id' field and both a query returning a list (no required args) and a query accepting 'id: ID'.
Verify the exact GraphQL type and field name in the schema.
Run 'npm install sofa-api graphql' or 'yarn add sofa-api graphql'.
Change import to: import { useSofa } from 'sofa-api'.Add an 'id' field of type ID to the type, e.g., 'id: ID'.