Document schema:delete command (#1290)

This commit is contained in:
Kamil Kisiela 2023-02-07 17:19:57 +01:00 committed by GitHub
parent 3688d09ab4
commit 6f17e0bbec
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 54 additions and 0 deletions

View file

@ -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",

View file

@ -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>