Skip to content

Commit

Permalink
Document schema:delete command (#1290)
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilkisiela authored Feb 7, 2023
1 parent 3688d09 commit 6f17e0b
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/web/docs/src/pages/features/_meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"tokens": "Managing Tokens",
"publish-schema": "Publishing Schema",
"checking-schema": "Checking Schema",
"delete-schema": "Deleting Schema",
"registry-usage": "Using Registry",
"monitoring": "Monitoring",
"schema-history": "Schema and History",
Expand Down
53 changes: 53 additions & 0 deletions packages/web/docs/src/pages/features/delete-schema.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import { Callout, PackageCmd } from '@theguild/components'

# Deleting a schema

In case you want to delete a schema (or a subgraph in case of Federation), you can do so by using
the `hive schema:delete` command.

## Requirements

- An active [token](./tokens) with "Read & Write" permissions to the Registry.
- Available only for Stitching and Federation projects

### NPM

Install [`@graphql-hive/cli`](https://www.npmjs.com/package/@graphql-hive/cli) package from NPM:

<PackageCmd packages={['-D @graphql-hive/cli']} />

### Linux / MacOS

Install latest version:

```bash
curl -sSL https://graphql-hive.com/install.sh | sh
```

Now, create a config file as `hive.json` and paste there your token:

```json
{
"token": "YOUR-TOKEN"
}
```

<Callout>
Having a config file is not mandatory, you can use `--token YOUR-TOKEN` or an environment variable
called `HIVE_TOKEN` instead.
</Callout>

To delete a schema, use `hive schema:delete` command:

```bash
hive schema:delete <service-name>
```

<Callout>

You can also use `--dryRun` flag first to see what effect the command will have on the registry.

In case you want to confirm deletion of the service without typing anything in the terminal, use
`--confirm` flag.

</Callout>

0 comments on commit 6f17e0b

Please sign in to comment.