Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: makes subgraph routing-url optional #484

Merged
merged 6 commits into from
May 3, 2021
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
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,19 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
[pull/487]: https://github.com/apollographql/rover/pull/487

## 🚀 Features

- **`--routing-url` is now an optional argument to `rover subgraph publish` - [EverlastingBusgtopper], [issue/169] [pull/484]**

When publishing a subgraph, it is important to include a routing URL for that subgraph, so your graph router
knows where to route requests for types in a subgraph. Previously, you had to specify this argument on
every `rover subgraph publish`, but now it acts as an upsert, meaning you must include it on your first
`rover subgraph publish`, but subsequent publishes will retain the existing routing URL for a subgraph
if `--routing-url` is not specified.

[EverlastingBusgtopper]: https://github.com/EverlastingBusgtopper
[pull/484]: https://github.com/apollographql/rover/pull/484
[issue/169]: https://github.com/apollographql/rover/issues/169

## 🐛 Fixes
## 🛠 Maintenance

Expand Down
2 changes: 1 addition & 1 deletion crates/rover-client/src/query/subgraph/publish.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ mutation PublishPartialSchemaMutation(
$graphId: ID!
$graphVariant: String!
$name: String!
$url: String!
$url: String
$revision: String!
$activePartialSchema: PartialSchemaInput!
$gitContext: GitContextInput!
Expand Down
6 changes: 4 additions & 2 deletions docs/source/subgraphs.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,11 @@ Alternatively, you can provide `-`, in which case the command uses an SDL string

<td>

**Required.** Used by a gateway running in [managed federation mode](https://www.apollographql.com/docs/federation/managed-federation/overview/).
The URL that your gateway uses to communicate with the subgraph in a [managed federation architecture](https://www.apollographql.com/docs/federation/managed-federation/overview/).

If you're running a subgraph that hasn't been deployed yet or isn't using managed federation, you can pass a placeholder URL or leave the flag empty.
**Required** the first time you publish a particular subgraph. Provide an empty string if your subgraph isn't deployed yet, or if you aren't using managed federation.

**Optional** after your first publish. Provide only if you need to change the subgraph's routing URL.

</td>
</tr>
Expand Down
2 changes: 1 addition & 1 deletion src/command/subgraph/publish.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ pub struct Publish {
/// (often a deployed subgraph). May be left empty ("") or a placeholder url
/// if not running a gateway in managed federation mode
#[structopt(long)]
routing_url: String,
routing_url: Option<String>,
}

impl Publish {
Expand Down