ClawKit Logo
ClawKitReliability Toolkit
Back to Registry
Official Verified developer tools Safety 4/5

rest-to-graphql

Convert REST API routes to a GraphQL schema. Use when migrating APIs or adding a GraphQL layer.

Why use this skill?

Instantly convert your REST API routes into a full GraphQL schema. Automate your migration, generate TypeScript types, and build a modern BFF layer.

skill-install — Terminal

Install via CLI (Recommended)

clawhub install openclaw/skills/skills/lxgicstudios/rest-to-graphql
Or

What This Skill Does

The rest-to-graphql skill is a specialized developer utility designed to bridge the gap between legacy RESTful architectures and modern GraphQL interfaces. By analyzing your existing API route definitions—such as Express or similar Node.js route patterns—it automates the complex task of schema creation. The skill parses your endpoints to identify resources, request parameters, and response structures, automatically mapping them to GraphQL types, queries, and mutations. Beyond mere structural mapping, it provides TypeScript type generation and optional resolver stubs that bridge your existing REST handlers. This allows developers to add a GraphQL layer to their existing services without manually rewriting logic or dealing with tedious schema definitions.

Installation

To integrate this skill into your workflow, use the OpenClaw CLI:

clawhub install openclaw/skills/skills/lxgicstudios/rest-to-graphql

No manual configuration is required. Once installed, ensure you are running a Node.js 18+ environment. You can trigger the core functionality via your terminal using the npx command as documented in the skill details: npx ai-rest-to-graphql ./src/routes.

Use Cases

This skill is perfect for teams undergoing a modernization effort. If you have a mature REST API but wish to leverage GraphQL's efficiency, this tool eliminates the manual overhead of building the layer from scratch. It is also ideal for building a Backend-for-Frontend (BFF) layer over microservices, where you need a unified API surface. Furthermore, it serves as a powerful learning tool for developers to see how their specific data models translate into GraphQL schemas.

Example Prompts

  1. "Convert my existing routes in ./src/api/v1 to a GraphQL schema file and include resolver stubs for the existing controllers."
  2. "Generate a GraphQL schema for my user and order resources from my REST route folder and export them to schema.graphql."
  3. "Analyze my REST API in ./server/routes and provide the TypeScript types for all GraphQL mutations, wrapping the existing REST endpoints as a datasource."

Tips & Limitations

  • Incremental Migration: Avoid converting the entire API surface at once. Start with your core high-traffic resources to ensure the mapping aligns with your expectations.
  • Relationship Mapping: While the tool does an excellent job of inferring basic types, it may require manual refinement for complex relational data (e.g., deeply nested objects or recursive types).
  • BFF Approach: Rather than replacing your REST services, consider using the --wrap-rest flag to keep your existing handlers as the source of truth, treating GraphQL as a presentation layer.
  • Review Generated Code: Always perform a quick sanity check on generated resolver stubs to ensure that the request parameters match your underlying business logic.

Metadata

Stars1601
Views1
Updated2026-02-27
View Author Profile
AI Skill Finder

Not sure this is the right skill?

Describe what you want to build — we'll match you to the best skill from 16,000+ options.

Find the right skill
Add to Configuration

Paste this into your clawhub.json to enable this plugin.

{
  "plugins": {
    "official-lxgicstudios-rest-to-graphql": {
      "enabled": true,
      "auto_update": true
    }
  }
}

Tags(AI)

#graphql#rest#migration#api-design#typescript
Safety Score: 4/5

Flags: file-read, file-write