This repository demonstrates how to host multiple WunderGraph Cloud projects in a single repository to deploy them as individual WunderGraph Cloud projects.
The right workspace path is read at build time from the wg.toml
file. Please modify the file to match your project names.
# Your cloud project with the name `a` will be deployed to https://a.wundergraph.dev
cd projects/a && npm i
# Your cloud project with the name `b` will be deployed to https://b.wundergraph.dev
cd projects/b && npm i
Note: You can also use PNPM, Yarn or any other package manager to manage your dependencies as a workspace.
- Fork this repo
- Sign in to WunderGraph Cloud
- Create a new project with the name
{YOUR_PROJECT_NAME-A}
- Import the forked repo
- Deploy the project
- Create a second project with the name
{YOUR_PROJECT_NAME-B}
Try it out (replace YOUR_PROJECT_NAME
with your project name in your wg.toml
file):
curl -X GET https://{YOUR_PROJECT_NAME-A}.wundergraph.dev/operations/get
curl -X GET https://{YOUR_PROJECT_NAME-B}.wundergraph.dev/operations/get
- Make changes to the
main
branch, e.g. change the TypeScript operation in.wundergraph/operations/get
- Commit and push the changes
See your changes live in less than a minute.
Read the Docs.