The GraphCDN CLI allows you to configure your cache from your codebase. We also recommend setting up a CI task to push the GraphQL schema to GraphCDN on every commit to your main/master/trunk/production branch.

Usage in CI

  1. Create a Personal Access Token for your account at https://graphcdn.io/dashboard/tokens Call it something like "CI"
  1. Set the GRAPHCDN_TOKEN environment variable in your CI service to your personal access token
  1. Add a task to your CI service for your production branch, which runs graphcdn push schema. This command will push your GraphQL schema changes to GraphCDN:
    1. npx graphcdn push schema

Local usage

Install the CLI using npm and login into your account:

npm install --global graphcdn
graphcdn login

After login, you can run these commands

# List all the services in an organization
graphcdn ls --org <org-slug>

# Push a specific configuration property to your service
graphcdn push schema
graphcdn push rules
# etc.

# Push your entire graphcdn.yml to your service
# WARNING: Dangerous. This will override any other changes made to your service's configuration!
graphcdn push

# Pull changes made on your service's dashboard into your graphcdn.yml
graphcdn pull