StepZen is now part of IBM. For the most recent product information and updates visit our
IBM product page.

Autogenerate GraphQL Schemas using the stepzen import CLI

Specify your data source with the `stepzen import` CLI. StepZen introspects the backend and generates your GraphQL schema.

StepZen lets you create a GraphQL API in minutes for all your data sources (SQL and NoSQL databases, REST and SOAP endpoints) and GraphQL APIs.

To use StepZen you need to install the StepZen CLI for development and deployment to the cloud, or for local development using Docker and deployed in your private cloud or colocation data center.

There are two ways to create your GraphQL API with StepZen:

  • Autogenerate GraphQL with the StepZen CLI Use the command-line interface (CLI)stepzen import to specify a backend data source. StepZen introspects it and generates a GraphQL schema for you.

  • Write GraphQL Schemas Using GraphQL Directives Write your schema code in a .graphql GraphQL Schema Definition Language (SDL) file. Use one of the powerful GraphQL directive @rest, @dbquery, and @graphql to connect a backend. With a few lines of declarative code, you have a working schema.

Autogenerate GraphQL Schemas with StepZen CLI

You can auto-generate your schemas using StepZen's stepzen import CLI command. This enables you to create a GraphQL schema for data sources including:

  • Any REST API, including REST interfaces on NoSQL databases:

    stepzen import curl "YOUR_ENDPOINT" --header "Authentication: 123"
  • SQL databases – MySQL and PostgreSQL:

    stepzen import mysql | postgresql
  • Any GraphQL API, including pre-built schemas available in StepZen GraphQL Studio:

    stepzen import graphql

When you run the command, you are prompted to provide access information (e.g., host, headers, etc.) for your data source. StepZen introspects the backend and generates the schema.

Getting Started Wizard

See the Getting Started Wizard to get started quickly with your own data source or explore examples.


For more information on using the stepzen import CLI commands see:

Write GraphQL Schemas Using GraphQL Directives

See the Write GraphQL Schemas for how to use GraphQL directives (@rest, @dbquery, @graphql) to write your GraphQL schema from scratch, or extend/customize what you create via stepzen import for any backend.