-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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 examples to all cli commands (#3475) #3492
Conversation
Beep boop! 🤖 Hey @ashishra0, thanks for your PR! One of my human friends will review this PR and get back to you as soon as possible. Stay awesome! 😎 |
Deploy preview for hasura-docs ready! Built with commit 8672d14 |
Review app for commit e7ae33a deployed to Heroku: https://hge-ci-pull-3492.herokuapp.com |
cli/commands/console.go
Outdated
# Start console without opening the browser automatically | ||
hasura console --no-browser | ||
|
||
# Apply admin secret for Hasura GraphQL Engine: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# Apply admin secret for Hasura GraphQL Engine: | |
# Use with admin secret: |
cli/commands/console.go
Outdated
# Apply admin secret for Hasura GraphQL Engine: | ||
hasura console --admin-secret "<admin-secret>" | ||
|
||
# Add Hasura GraphQL Server endpoint: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# Add Hasura GraphQL Server endpoint: | |
# Connect to an instance specified by the falg, over-rides the one mentioned in config.yaml |
cli/commands/console.go
Outdated
hasura console --admin-secret "<admin-secret>" | ||
|
||
# Add Hasura GraphQL Server endpoint: | ||
hasura console --admin-secret "<admin-secret>"`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use --endpoint
instead of admin secret (repetition)
cli/commands/migrate_squash.go
Outdated
hasura migrate squash --endpoint "<http-endpoint>" | ||
|
||
# Add a name for the new squashed migration | ||
hasura migrate squash --name "<name>"`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hasura migrate squash --name "<name>"`, | |
hasura migrate squash --name "<name>" --from 123`, |
cli/commands/migrate_status.go
Outdated
# Create migration files from server: | ||
hasura migrate create "<filename>" --from-server |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this
cli/commands/migrate_status.go
Outdated
# Create migration files from server: | ||
hasura migrate create "<filename>" --from-server | ||
|
||
# Add admin secret for Hasura GraphQL Engine: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# Add admin secret for Hasura GraphQL Engine: | |
# Use with admin secret: |
cli/commands/migrate_status.go
Outdated
# Add admin secret for Hasura GraphQL Engine: | ||
hasura migrate status --admin-secret "<your-admin-secret>" | ||
|
||
# Add Hasura GraphQL Server endpoint: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# Add Hasura GraphQL Server endpoint: | |
# Check status on a different server: |
cli/commands/migrate_status.go
Outdated
hasura migrate status --admin-secret "<your-admin-secret>" | ||
|
||
# Add Hasura GraphQL Server endpoint: | ||
hasura migrate status --endpoint "<http-endpoint>"`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hasura migrate status --endpoint "<http-endpoint>"`, | |
hasura migrate status --endpoint "<endpoint>"`, |
Review app for commit 453d195 deployed to Heroku: https://hge-ci-pull-3492.herokuapp.com |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ashishra0 Check the indentation across all files and the review comments specificatlly
cli/commands/console.go
Outdated
@@ -30,11 +30,21 @@ func NewConsoleCmd(ec *cli.ExecutionContext) *cobra.Command { | |||
Use: "console", | |||
Short: "Open console to manage database and try out APIs", | |||
Long: "Run a web server to serve Hasura Console for GraphQL Engine to manage database and build queries", | |||
Example: ` # Start console: | |||
Example: ` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indentation is with tabs and spaces mixed here.
Always use two spaces to indent multiline strings.
cli/commands/console.go
Outdated
# Use with admin secret: | ||
hasura console --admin-secret "<admin-secret>" | ||
|
||
# Connect to an instance specified by the flag, over-rides the one mentioned in config.yaml: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
override is a single word
cli/commands/metadata_apply.go
Outdated
Example: ` # Apply Hasura GraphQL Engine metadata present in metadata.[yaml|json] file: | ||
hasura metadata apply`, | ||
Example: ` | ||
# Apply Hasura GraphQL Engine metadata present in metadata.[yaml|json] file: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change these to spaces. 1st line should start after the backquote and two spaces.
cli/commands/metadata_clear.go
Outdated
@@ -18,8 +18,15 @@ func newMetadataClearCmd(ec *cli.ExecutionContext) *cobra.Command { | |||
Use: "clear", | |||
Aliases: []string{"reset"}, | |||
Short: "Clear Hasura GraphQL Engine metadata on the database", | |||
Example: ` # Clear all the metadata information from database: | |||
hasura metadata clear`, | |||
Example: ` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change these too to spaces.
cli/commands/metadata_export.go
Outdated
@@ -23,8 +23,15 @@ func newMetadataExportCmd(ec *cli.ExecutionContext) *cobra.Command { | |||
metadataExportCmd := &cobra.Command{ | |||
Use: "export", | |||
Short: "Export Hasura GraphQL Engine metadata from the database", | |||
Example: ` # Export metadata and save it in migrations/metadata.yaml file: | |||
hasura metadata export`, | |||
Example: ` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indentation issues here too.
Review app for commit 8672d14 deployed to Heroku: https://hge-ci-pull-3492.herokuapp.com |
Review app https://hge-ci-pull-3492.herokuapp.com is deleted |
Beep boop! 🤖 Awesome work @ashishra0! All of us at Hasura ❤️ what you did. Thanks again 🤗 |
Description
Add examples to Hasura CLI commands #3475
Affected components