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

add documention for the rover readme commands #1141

Merged
merged 3 commits into from
Jun 7, 2022
Merged
Show file tree
Hide file tree
Changes from 2 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
5 changes: 3 additions & 2 deletions docs/source/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
"Contributing": "/contributing",
"Migrating from the Apollo CLI": "/migration",
"Base Commands": {
"graph": "/graphs"
"graph": "/graphs",
"readme": "/readmes"
},
"Federation Commands": {
"subgraph": "/subgraphs",
Expand All @@ -28,4 +29,4 @@
"Error codes": "/errors"
}
}
}
}
61 changes: 61 additions & 0 deletions docs/source/readmes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
---
title: Rover README commands
description: Publish and retrieve your graph variant's README
---

These Rover commands are for publishing and fetching the [README](https://www.apollographql.com/docs/studio/org/graphs/#the-readme-page) associated with a graph variant.

READMEs are [Markdown based](https://www.apollographql.com/docs/studio/org/graphs/#supported-markdown), and support Apollo-specific shortcodes, which are documented [here](https://www.apollographql.com/docs/studio/org/graphs/#readme-shortcodes).

## Fetching a README from Apollo Studio

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

You can use Rover to fetch the README of any Studio graph variant.

Run the `readme fetch` command, like so:

```bash
rover readme fetch my-graph@my-variant
```

The argument `my-graph@my-variant` is the `graph ref`, which you can read about [here](http://localhost:8000/rover/conventions#graph-refs).

### Output format

By default, the README will be output to `stdout`. You can also save the output to a `.md` file like so:

```bash
# Creates README.md or overwrites if it already exists
rover readme fetch my-graph@my-variant > README.md
```

To request the output as JSON, use the `--output json` option:
```bash
rover readme fetch my-graph@my-variant --output json
```

> For more on passing values via `stdout`, see [Conventions](./conventions#using-stdout).

## Publishing a README to Apollo Studio

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

You can use Rover to publish a README to one of your [Apollo Studio graphs](/studio/org/graphs/).

Use the `readme publish` command, like so:

```bash
rover readme publish my-graph@my-variant --file ./README.md
```

The argument `my-graph@my-variant` is the `graph ref`, which you can read about [here](http://localhost:8000/rover/conventions#graph-refs).

You can also pipe the contents of the README in via `stdin` by providing `-` as the value of the `--file` option, like so:

```bash
echo "sample readme contents" | rover readme publish my-graph@my-variant --file -
```

> For more on accepting input via `stdin`, see [Conventions](./conventions#using-stdin).