Using GraphiQL for local API testing

Test your GraphQL APIs locally by running queries with the embedded GraphiQL interface.

About this task

Use the embedded GraphiQL interface to test your GraphQL APIs locally. This interface serves as a local proxy to your GraphQL API. It is only available when you are running stepzen start --dashboard=local, and becomes unavailable when you stop the development environment.

Procedure

  1. Deploy a schema to API Connect Essentials.

  2. Enter development mode by running the following command:
    stepzen start --dashboard=local
  3. Open a browser and navigate to the GraphiQL interface at the following address:
    http://localhost:5001/<endpoint>

    For example, if your endpoint is api/my-stepzen-endpoint, you can access the embedded GraphiQL interface at http://localhost:5001/api/my-stepzen-endpoint.

    You can only use the localhost endpoint for GraphiQL in the browser. For network requests, you must use the actual GraphQL endpoint that was created.

    Since the local proxy is only used for the development of your endpoint, it makes requests using the Admin key by default. If it were a true proxy, it could create a security vulnerability. To prevent that, the proxy only accepts requests from the stepzen start workspace running in your browser.