Loading...
Please wait a moment

SQL to GraphQL Converter Online — Convert SQL Schemas to GraphQL

Paste your SQL query or CREATE TABLE statement above and get the equivalent GraphQL schema instantly. This tool converts SELECT columns to field selections, SQL types to GraphQL scalar types, and WHERE clauses to query arguments — all processed in your browser with no data sent to any server.

How to Convert SQL to GraphQL — Step-by-Step

Step 1

Input Your SQL

Moving from a relational database to a GraphQL API? Paste your SQL from your database client, migration files, or application code.

Paste: Copy your SQL query and paste — conversion is instant
Upload: Select a .sql file
Sample: See a CREATE TABLE statement converted to a full GraphQL schema
Step 2

Automatic Conversion

The converter maps SQL concepts to GraphQL:

Table names: Become GraphQL type names (capitalized)
Column types: INT becomes Int, VARCHAR becomes String, BOOLEAN becomes Boolean
NOT NULL: Becomes a non-nullable field (!)
PRIMARY KEY: Becomes ID! type
Step 3

Copy or Download

Copy: Paste into your GraphQL server or schema definition
Download: Save as .graphql

Frequently Asked Questions

How does SQL map to GraphQL?

In GraphQL schema design, database tables become types, columns become fields with appropriate scalar types, PRIMARY KEY columns become ID! fields, and NOT NULL constraints translate to non-nullable (!) types.

Does it support SELECT queries?

Yes. SELECT queries are converted into GraphQL queries with field selections matching the selected columns, WHERE conditions becoming query arguments, and ORDER BY / LIMIT becoming additional arguments.

What SQL types are supported?

INT/SERIAL map to Int, FLOAT/DECIMAL/NUMERIC to Float, BOOLEAN to Boolean, and all string-like types (VARCHAR, TEXT, DATE, TIMESTAMP) map to String. See the GraphQL scalar types documentation for details.

Is this converter free?

Completely free, no limits. Also try: GraphQL to SQL, MongoDB to GraphQL, GraphQL to REST, GraphQL Formatter.