Setting up your environment
Get your account information
Contact your API Connect for GraphQL administrator for the account name, the domain, and the keys.
Your administrator provides the following keys for your account:
- Account name: Your organization shares a single account, which serves as a user name when you log in.
- Domain: The domain where API Connect for GraphQL is installed, which you specify when you log in.
- Admin key: Grants access to upload, modify, configure, and deploy APIs.
When you log in to API Connect for GraphQL, you will be prompted for the admin key instead of a password.
- API key: Grants access to consume GraphQL APIs and query the endpoints.
The API key is required for connecting to the APIs deployed to API Connect for GraphQL. Pass this key through the
Authorizationheader in the following format:Authorization: apikey {APIKEY}
Install the CLI
Use the CLI (command-line interface) to work with API Connect for GraphQL and your GraphQL APIs. The CLI is supported on Windows, Mac, and Linux.
- Install the Node.js
runtime.
Nodeis required for running the CLI. - Install the CLI by running the following
command:
npm install -g stepzenIf you receive EACCES errors with installing globally, see the Resolving EACCES permissions errors when installing packages globally in the
Nodedocumentation. - (Optional) Customize the default CLI configuration as explained in Configuring the CLI.
Log in to API Connect for GraphQL using account name
API Connect for GraphQL does not provide a graphical UI. Instead, you use the CLI to work with the service.
- Log in by running the following
command:
stepzen login <domain> -a <account>where:
<domain>is the domain or the region where API Connect for GraphQL is installed or hosted. For example,eu-central-a.ibm.stepzen.netorus-east-a.ibm.stepzen.net<account>is the username of the account you want to log in to.
For example, if the environment name (account) is
production, and the domain isenvname.us-east-a.ibm.stepzen.net, then the login command looks like the following example:stepzen login envname.us-east-a.ibm.stepzen.net -a productionConsider another example where the environment name (account) isbeaverdamand API Connect for GraphQL is hosted in theenvname.eu-central-a.ibm.stepzen.netregion. In this scenario, the login command is:stepzen login envname.eu-central-a.ibm.stepzen.net -a beaverdam - When prompted, enter the admin key for the account.
https://<environment_name>.<domain>https://envname.us-east-a.ibm.stepzen.netLog in to API Connect for GraphQL using instance ID
API Connect for GraphQL does not provide a graphical UI. Instead, you use the CLI to work with the service.
- Log in by running the following
command:
stepzen login <domain> -i <instance_id>where:
- <instance_id> is the ID of your service instance associated with your subscription.
<domain>is the domain or the region where API Connect for GraphQL is hosted. For example,eu-central-a.ibm.stepzen.netorus-east-a.ibm.stepzen.net
For example, if the instance_id is
20250420-0847-3668-7006-2138aaf44423, and the service instance is hosted inenvname.us-east-a.ibm.stepzen.net, then the login command looks like the following example:stepzen login envname.us-east-a.ibm.stepzen.net -i 20250420-0847-3668-7006-2138aaf44423 - When prompted, enter the IBM SaaS Console API key for the account you are logging into. To
generate an API key from the IBM SaaS Console, see Creating API keys.Note: To access IBM API Connect for GraphQL through the IBM SaaS Console, you must have one of the following roles: service owner, APICGQL admin, or APICGQL developer. To create an API key within the IBM SaaS Console, you must have at least the service admin or service user role.
https://<environment_name>.<domain>https:///envname.us-east-a.ibm.stepzen.net/Create a workspace directory for your project
When you are ready to starting building GraphQL APIs, change to the appropriate workspace directory to ensure your artifacts are stored in the correct location.
- Create a workspace directory where you will work on a particular project.
Name the directory whatever you like.
- Change to the new workspace directory.
- Run the following command to initialize the workspace:
stepzen init
Get your API endpoint URL
The API endpoint URL is based on your account name, domain, and API name.
- In your initialized workspace directory, run the following
command:
stepzen start - Note down the API endpoint URL that displays in the response.
For example, if your account name is
production, your domain isexample.com, and your API name isharping-cat, you will see the following output:Your API url is https://production.example.com/api/harping-cat/__graphqlWhen you deploy an API, it is uploaded to this endpoint.
(Optional) Install Docker for local development
For instructions on setting up Docker for use with API Connect for GraphQL, see Using Docker for local API development.