How to use Stellate in Development

Since version 1.3.0 of the Stellate CLI , you can proxy requests to your local development GraphQL backend via Stellate. This allows you to test the behavior of your app with Stellate enabled, as well as your Stellate configuration.

To give this a try you'll need to have an account with Stellate. If you're new, please sign up first and then run stellate login to sign in to your account.

Next, you'll either need to pull your stellate.yml configuration (via the stellate pull command) or create a scaffolding configuration that looks like this:

# Skeleton stellate.yml
name: local-dev
app: local-dev
schema: http://graphql.local
originUrl: http://graphql.local

Also, make sure your development GraphQL server is up and running and accepting requests.

Once you're ready, you can create the development environment via the following command:

stellate serve --backend-port <port> --service <service name>

As service name use the same value provided in your stellate.yml file. In the example configuration above we'd use local-dev as the service name.

The serve command supports the following options:

  • --backend-port, the port on your local host your GraphQL server is running on
  • --service, the name of the service if not specified in the stellate.yml file
  • --serve-port, the port you want to have the Stellate environment available on, defaults to the first free port greater than 3000 (Optional)
  • --watch, whether to watch the stellate.yml file for changes.
  • --path, the path your GraphQL API is available on, e.g. /graphql

This will make debugging your Stellate setups, as well as giving Stellate a try, a lot easier.


Did this page help you?