Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
A fully open-source MIT-licensed GraphQL API router that can act as a [GraphQL federation](https://the-guild.dev/graphql/hive/federation) Router, built with Rust for maximum performance and robustness.

> [!TIP]
> 🚀 [Blog post: Welcome Hive Router](https://the-guild.dev/graphql/hive/blog/welcome-hive-router)
>
> 🚀 [Blog post: Welcome Hive Router](https://the-guild.dev/graphql/hive/blog/welcome-hive-router)
>
> Interested in the benchmark results? Check out the [Federation Gateway Performance comparison](https://the-guild.dev/graphql/hive/federation-gateway-performance)

It can be run as a standalone binary or a Docker Image. Query planner can be used as a standalone Crate library.
Expand All @@ -26,7 +26,7 @@ curl -o- https://raw.githubusercontent.com/graphql-hive/router/main/install.sh |
Create a simple configuration file that points to your supergraph schema file:

```yaml
# hive-router.config.yaml
# router.config.yaml
supergraph:
source: file
path: ./supergraph.graphql
Expand All @@ -42,7 +42,7 @@ HIVE__SUPERGRAPH__PATH=./supergraph.graphql
Then, run the router:

```bash
# By default, "hive-router.config.yaml" is used for configuration. Override it by setting "ROUTER_CONFIG_FILE_PATH=some-custom-file.yaml"
# By default, "router.config.yaml" is used for configuration. Override it by setting "ROUTER_CONFIG_FILE_PATH=some-custom-file.yaml"
# If you are using env vars, make sure to set the variables before running the router.
./hive_router
```
Expand Down Expand Up @@ -71,7 +71,7 @@ Alternativly, you can mount the configuration file using `-v` and pass all other
```bash
docker run \
-p 4000:4000 \
-v ./hive-router.config.yaml:/app/hive-router.config.yaml \
-v ./router.config.yaml:/app/router.config.yaml \
ghcr.io/graphql-hive/router:latest
```

Expand Down
8 changes: 4 additions & 4 deletions lib/router-config/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,10 @@ pub enum RouterConfigError {
}

static DEFAULT_FILE_NAMES: &[&str] = &[
"hive-router.config.yaml",
"hive-router.config.yml",
"hive-router.config.json",
"hive-router.config.json5",
"router.config.yaml",
"router.config.yml",
"router.config.json",
"router.config.json5",
Comment on lines +81 to +84
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This is a breaking change for users relying on the default configuration file name. To provide a smoother migration path and avoid breaking existing setups, I suggest supporting both the old and new file names for a while.

You can achieve this by including the old file names in this list. By placing the new names after the old ones, you ensure they have higher precedence, as the config crate merges sources in order.

This makes the change backward-compatible for existing users, while the updated documentation encourages new users to adopt the new naming convention.

    // Old names (deprecated, for backward compatibility)
    "hive-router.config.yaml",
    "hive-router.config.yml",
    "hive-router.config.json",
    "hive-router.config.json5",
    // New standard names
    "router.config.yaml",
    "router.config.yml",
    "router.config.json",
    "router.config.json5"

];

pub fn load_config(
Expand Down
Loading