💙 Supporting healthcare non-profits: Metadataloop is free for 6–12 months. Contact Us to get started.
Developer Utility

SQL / CSV → GraphQL Schema Generator

Paste CREATE TABLE SQL, or a CSV/JSON sample — get a GraphQL type definition with primary keys mapped to ID, nullable columns left optional, and names converted to camelCase.

Input type
Input · CREATE TABLE SQL
Output · GraphQL type defs
# Output will appear here.

Generate GraphQL type definitions from SQL, CSV, or JSON

Scaffolding a GraphQL API from an existing relational schema usually means writing every type by hand. Paste your CREATE TABLE statements — or a CSV/JSON sample if you don't have DDL yet — and this tool emits clean GraphQL type definitions ready to drop into a schema file.

Type mapping rules

  • Primary keys and UUID columns → ID.
  • Integer / serial columns → Int.
  • Decimal / float / numeric columns → Float.
  • Boolean / bit columns → Boolean.
  • Everything else (varchar, text, date, timestamp) → String.
  • Non-nullable columns and primary keys get the GraphQL ! required marker.

Example

CREATE TABLE users (
  id UUID PRIMARY KEY,
  email VARCHAR(255) NOT NULL,
  full_name VARCHAR(120)
);

GraphQL output:

type Users {
  id: ID!
  email: String!
  fullName: String
}

Common use cases

API scaffolding

Bootstrap a GraphQL server's schema file directly from your existing tables.

BFF / gateway layers

Quickly expose a relational table as a GraphQL type behind a gateway.

No-DDL prototyping

Have a CSV export but no schema yet? Infer types directly from the sample.

Schema-first discussions

Share a draft GraphQL type with a frontend team before committing to a DB schema.

FAQ

Does it generate relation fields for foreign keys? Not automatically — foreign key columns are emitted as scalar ID/Int fields; add nested relation fields by hand once both types exist.

Can I use this for a federated/Apollo schema? Yes — the output is plain SDL and can be merged into any GraphQL schema, including Apollo Federation subgraphs.

Is my input stored anywhere? No — it's parsed in-memory for the single request and discarded.

⚠ Confirm Delete