REST to GraphQL Converter for Openclaw

Automatically transform your REST API endpoints into a production-ready GraphQL schema with zero manual configuration.

lxgicstudios
v1.0.1
Jan 29, 2026
0
0
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install rest-to-graphql

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install rest-to-graphql using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is REST to GraphQL Converter?

The REST to GraphQL converter is a high-performance utility designed to streamline the modernization of web services. By integrating this tool into your workflow through Openclaw Skills, you can programmatically translate complex RESTful architectures into structured GraphQL schemas, including queries, mutations, and types. It eliminates the tedious task of manual type mapping, allowing developers to focus on building features rather than boilerplate code.

This tool is particularly valuable for teams looking to implement a Backend-for-Frontend (BFF) pattern or those undergoing a full architectural migration. It preserves the integrity of your existing business logic while providing the flexibility and efficiency of a graph-based query language.

REST to GraphQL Converter Use Cases

  • Migrating legacy REST APIs to a GraphQL-based architecture without manual rewriting.
  • Building a GraphQL gateway or BFF layer over existing microservices.
  • Rapidly prototyping data models by visualizing current REST endpoints as a graph.
  • Generating TypeScript types and resolver stubs to ensure end-to-end type safety during migrations.

How REST to GraphQL Converter Works

  1. The tool scans a specified directory or file containing REST route definitions.
  2. It parses the HTTP methods and URI patterns to identify resources and CRUD operations.
  3. GET endpoints are automatically mapped to GraphQL queries, while POST, PUT, and DELETE methods are converted into mutations.
  4. Request and response bodies are analyzed to infer data structures and generate corresponding GraphQL types.
  5. The tool generates a schema file and, optionally, resolver stubs that proxy requests to your existing REST handlers.

REST to GraphQL Converter Setup

The REST to GraphQL converter requires Node.js 18 or higher. You can run it directly without a permanent installation via npx as part of your Openclaw Skills toolkit:

# Process an entire routes directory
npx ai-rest-to-graphql ./src/routes

# Process a specific resource file
npx ai-rest-to-graphql ./src/routes/users.ts

# View all configuration options
npx ai-rest-to-graphql --help

REST to GraphQL Converter Data Schema & Taxonomy

The utility organizes output into structured GraphQL components based on your source REST architecture:

Output Component Description
Schema Definition A .graphql file containing all inferred types, queries, and mutations.
Resolver Stubs Optional implementation files that bridge the GraphQL layer to existing REST routes.
TypeScript Mappings Inferred type definitions used for consistent data handling across the stack.

REST to GraphQL Converter Advanced Features

  • Automatic resolver stub generation using the --with-resolvers flag to speed up implementation.
  • Support for the --wrap-rest mode, which maintains your REST API as the underlying datasource.
  • Customizable output file targeting using the -o flag for seamless project integration.
  • Intelligent relationship mapping between resources based on route nesting and parameter naming.

SKILL.md


Loading

METADATA

Github Stars: 0
forks: 0