StepZen is now part of IBM. For the most recent product information and updates go to
https://www.ibm.com/products/stepzen

CLI Configuration

Configure the StepZen CLI for testing and deployment

When you run stepzen start to deploy and test your schema, you may notice a new file created within your working directory named stepzen.config.json. This is a configuration file used by the StepZen CLI to manage some settings.

You typically do not need to modify this file. For those cases where you may want to do so, the following subsections describe configuration modifications you can make in stepzen.config.json:

Modify the Directory Name and Endpoint Name of a Deploy

When you first call stepzen start for a schema, the CLI asks you to provide a directory name and endpoint name for the deployed schema. This is required to be in the format: directory_name/endpoint_name.

You can choose whatever you like for either value, keeping in mind that this determines the GraphQL endpoint URL that you'll call to access this API. For example, if your account name is brian and you supply a directory name/endpoint name of api/my_first_endpoint, then the GraphQL endpoint URL to query the deployed schema will be https://brian.stepzen.net/api/my_first_endpoint/__graphql.

The endpoint name is stored in the stepzen.config.json file under the endpoint value:

{
  "endpoint": "api/my_first_endpoint"
}

On subsequent stepzen start runs in this directory, the CLI will reference this file to get the directory name and endpoint name to deploy to StepZen. If you'd like to change either of these, you can manually update the file.

For example, if you change the value to the following:

{
  "endpoint": "api/my_second_endpoint"
}

Running stepzen start will deploy to https://brian.stepzen.net/api/my_second_endpoint/__graphql, assuming your account is still brian. However, it's important to note that:

  • This will not remove the deployed endpoint at api/my_first_endpoint.
  • This will overwrite any existing endpoint at api/my_second_endpoint.

Change the Root Directory for GraphQL Schema Files

By default, stepzen.config.json currently only contains the endpoint value, but you can add a value for root to customize where the CLI looks for the .graphql schema files.

For example, a common pattern is to build your schema files in a subdirectory of your web application such as /schema or /stepzen. If you would like to be able to run stepzen start from the root of your application and you have the schema files in a stepzen folder, you can add a root property to

{
  "endpoint": "api/my_first_endpoint",
  "root": "stepzen"
}

Running stepzen start from the directory will now look for the .graphql files in the /stepzen directory.