Before creating a GraphQL API with StepZen, you must install the CLI (command-line interface) to help you quickly build and deploy your StepZen API. This topic describes how to set up this tool.
Install StepZen
The StepZen command-line interface (CLI) provides commands to set up and manage StepZen.
Invoke the following command to install the StepZen CLI:
npm install -g stepzen
Note: The StepZen CLI is supported on Windows, OSX, and Linux. If you're running into EACCES errors with installing globally, we recommend consulting npm's official documentation.
Create an account
Sign up for a free StepZen account.
Your Admin Key and API Key**
When you get your account, log in to StepZen and navigate to the StepZen dashboard, where you will find your account name, and the two keys you need for API authentication:
- Admin Key: Required to upload, modify, configure, and deploy your StepZen APIs.
- API Key: Grants access to consume/query your endpoint. You need this API Key to consume your StepZen GraphQL API.
Running StepZen
Cloud
To run StepZen in the cloud, you can connect the CLI to your account to get a private and secure endpoint or use StepZen with a public account.
After installing the CLI, you can connect it to your account.
Start by logging in using the following command:
stepzen login
You'll see a series of command prompts asking for your StepZen account name and admin key:
What is your account name?: {ACCOUNT} What is your admin key?: {ADMINKEY}
If you don't see your account name and admin key above, you can also find them on the StepZen Dashboard after logging in to access your deployment-ready endpoint.
Local development using Docker
StepZen can also be run using Docker for local development purposes. By running StepZen locally, you can create a GraphQL API for your data sources without signing up for an account or uploading any data to StepZen's cloud.
You can now proceed to build your GraphQL API:
-
Specify a backend on the command line; StepZen introspects it and generates a GraphQL schema
-
Write GraphQL Schemas using @rest, @dbquery, @graphql
- Write GraphQL Schemas (docs)