[BETA] Local GraphCDN Development Environments
With version 1.3.0 of the GraphCDN CLI we released a new feature in beta that allows you to spin up a GraphCDN service for your local development environment.
Over the last couple of weeks, we noticed that it was quite hard to "just try" GraphCDN. You typically had to target a production instance of your GraphQL backend, or at least an instance exposed to the internet. With the new serve
command you can point GraphCDN at a locally running GraphQL API and use it in your development environment.
To give this a try you'll need to have an account with GraphCDN. If you're new, please sign up first and then run graphcdn login
to sign in to your account.
Next, you'll either need to pull your graphcdn.yml configuration (via the graphcdn pull
command) or create a scaffolding configuration that looks like this:
# Skeleton graphcdn.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:
graphcdn serve --backend-port <port> --service <service name>
As service name use the same value provided in your graphcdn.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 thegraphcdn.yml
file--serve-port
, the port you want to have the GraphCDN environment available on, defaults to the first free port greater than 3000 (Optional)--watch
, whether to watch thegraphcdn.yml
file for changes.--path
, the path your GraphQL API is available on, e.g. /g
raphql
This will make debugging your GraphCDN setups, as well as giving GraphCDN a try, a lot easier. Let us know what you think and if you have questions, please reach out to us via support@graphcdn.io.