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.

There are two ways to create your GraphQL API with StepZen on SQL and NoSQL databases, REST endpoints, and even other GraphQL APIs.

  • 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 (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, credentials, 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: Custom Directives 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.

This site uses cookies: By using this website, you consent to our use of cookies in accordance with our Website Terms of Use and Cookie Policy.