https://github.com/patrick91/livestream-demo-rust
https://github.com/patrick91/livestream-demo-rust
Last synced: 12 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/patrick91/livestream-demo-rust
- Owner: patrick91
- License: mit
- Created: 2023-02-22T17:12:54.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-02-22T17:37:31.000Z (over 3 years ago)
- Last Synced: 2025-03-01T02:22:05.277Z (over 1 year ago)
- Language: Rust
- Size: 26.4 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# async-graphql Subgraph Template
[](https://railway.app/new/template/1KF0vV)
This template can be used to quickly create an [Apollo Federation] subgraph with the [async-graphql] crate.
## What's Included
- A basic, [Apollo Federation] subgraph with simple examples for queries, entities, and mutations. You can run this subgraph with `cargo run` or `cargo watch -x run` if using [cargo-watch] for auto-reloading.
- Example tests in the `tests` directory. You can run these tests with `cargo test`.
- GitHub Actions workflows which will:
- Run `cargo test` on every push.
- Check the schema against Apollo Studio on every push.
- Publish the subgraph to Apollo Studio on every push to the `main` branch.
## Next Steps
- Download [Rover] and start it using the command printed out from `cargo run` to start a local version of Apollo Explorer.
- Replace "my-subgraph" in `Cargo.toml` with the name of your subgraph.
- Start filling in your own types and resolvers in `src/lib.rs`.
- Set these secrets in GitHub Actions:
- `APOLLO_KEY`: An Apollo Studio API key for the supergraph to enable schema checks and publishing of the subgraph.
- `APOLLO_GRAPH_REF`: The name of the supergraph in Apollo Studio.
- `PRODUCTION_URL`: The URL of the deployed subgraph that the supergraph gateway will route to.
- Remove the `if: false` lines from `.github/workflows/checks.yaml` and `.github/workflows/deploy.yaml` to enable schema checks and publishing.
- Write your custom deploy logic in `.github/workflows/deploy.yaml`.
- Send the `Router-Authorization` header [from your Cloud router](https://www.apollographql.com/docs/graphos/routing/cloud-configuration#managing-secrets) and set the `ROUTER_SECRET` environment variable wherever you deploy this to.
[apollo federation]: https://www.apollographql.com/docs/federation/
[async-graphql]: https://async-graphql.github.io/async-graphql/
[cargo-watch]: https://crates.io/crates/cargo-watch
[rover]: https://www.apollographql.com/docs/rover/