-
Notifications
You must be signed in to change notification settings - Fork 104
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Document schema:delete command (#1290)
- Loading branch information
1 parent
3688d09
commit 6f17e0b
Showing
2 changed files
with
54 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |