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: adds rover graph delete #861

Merged
merged 6 commits into from
Oct 25, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
11 changes: 10 additions & 1 deletion docs/source/graphs.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,4 +119,13 @@ To configure the behavior of schema checks (such as the time range of past opera

> This requires first [authenticating Rover with Apollo Studio](./configuring/#authenticating-with-apollo-studio).

You can delete a single variant of a graph by running `rover graph delete`. If this graph is federated, it will also delete all of the subgraphs, meaning any of Rover's `fetch` commands will no longer work with this variant. This command will prompt you for confirmation before deletion since the action is irreversible. You can bypass this confirmation by passing the `--confirm` flag.
You can delete a single variant of a graph by running `rover graph delete`:

```bash
# ⚠️ This action is irreversible!
rover graph delete my-graph@variant-to-delete
```

This command prompts you for confirmation because the action is irreversible. You can bypass confirmation by passing the `--confirm` flag.

If you delete a federated variant with this command, it _also_ deletes all of that variant's subgraphs. To delete a single subgraph while preserving the variant, see [Deleting a subgraph](./subgraphs/#deleting-a-subgraph).
17 changes: 15 additions & 2 deletions docs/source/subgraphs.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ The argument `my-supergraph@my-variant` in the example above is a [graph ref](./

> You can omit `@` and the variant name. If you do, Rover publishes the schema to the default variant, named `current`.

If the graph exists in the graph registry, but the variant does not, a new variant will be created on publish.
If the graph exists in the graph registry but the variant does _not_, a new variant is created on publish.

Options include:

Expand Down Expand Up @@ -237,4 +237,17 @@ To configure the behavior of schema checks (such as the time range of past opera

## Deleting a subgraph

You can delete a single subgraph by running `rover subgraph delete`. Note that this command will error if any other subgraph references types specified by the subgraph you're deleting. If you'd rather delete all of the subgraphs for a variant, see the docs for [`graph delete`](./graphs/#deleting-a-variant).
> This requires first [authenticating Rover with Apollo Studio](./configuring/#authenticating-with-apollo-studio).

You can delete a single subgraph from a federated graph by running `rover subgraph delete`:

```bash
# ⚠️ This action is irreversible!
rover subgraph delete my-graph@my-variant --name subgraph-to-delete
```

This command prompts you for confirmation because the action is irreversible. You can bypass confirmation by passing the `--confirm` flag.
EverlastingBugstopper marked this conversation as resolved.
Show resolved Hide resolved

This command fails with an error if any _other_ subgraph references types that originate in this subgraph.

To delete an entire federated graph instead of a single subgraph, see [Deleting a variant](./graphs/#deleting-a-variant).