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 examples to all cli commands (#3475) #3492

Merged
merged 14 commits into from
Dec 12, 2019

Conversation

ashishra0
Copy link
Contributor

Description

Add examples to Hasura CLI commands #3475

Affected components

  • CLI

@ashishra0 ashishra0 requested a review from shahidhk as a code owner December 5, 2019 05:38
@hasura-bot
Copy link
Contributor

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! 😎

@claassistantio
Copy link

claassistantio commented Dec 5, 2019

CLA assistant check
All committers have signed the CLA.

@netlify
Copy link

netlify bot commented Dec 5, 2019

Deploy preview for hasura-docs ready!

Built with commit 8672d14

https://deploy-preview-3492--hasura-docs.netlify.com

@hasura-bot
Copy link
Contributor

Review app for commit e7ae33a deployed to Heroku: https://hge-ci-pull-3492.herokuapp.com
Docker image for server: hasura/graphql-engine:pull3492-e7ae33a2

@shahidhk shahidhk changed the title Cli commands example (#3475) add examples to all cli commands (#3475) Dec 5, 2019
cli/commands/console.go Show resolved Hide resolved
# Start console without opening the browser automatically
hasura console --no-browser

# Apply admin secret for Hasura GraphQL Engine:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# Apply admin secret for Hasura GraphQL Engine:
# Use with admin secret:

# Apply admin secret for Hasura GraphQL Engine:
hasura console --admin-secret "<admin-secret>"

# Add Hasura GraphQL Server endpoint:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# Add Hasura GraphQL Server endpoint:
# Connect to an instance specified by the falg, over-rides the one mentioned in config.yaml

hasura console --admin-secret "<admin-secret>"

# Add Hasura GraphQL Server endpoint:
hasura console --admin-secret "<admin-secret>"`,
Copy link
Member

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/metadata_apply.go Outdated Show resolved Hide resolved
hasura migrate squash --endpoint "<http-endpoint>"

# Add a name for the new squashed migration
hasura migrate squash --name "<name>"`,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
hasura migrate squash --name "<name>"`,
hasura migrate squash --name "<name>" --from 123`,

Comment on lines 25 to 26
# Create migration files from server:
hasura migrate create "<filename>" --from-server
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this

# Create migration files from server:
hasura migrate create "<filename>" --from-server

# Add admin secret for Hasura GraphQL Engine:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# Add admin secret for Hasura GraphQL Engine:
# Use with admin secret:

# Add admin secret for Hasura GraphQL Engine:
hasura migrate status --admin-secret "<your-admin-secret>"

# Add Hasura GraphQL Server endpoint:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# Add Hasura GraphQL Server endpoint:
# Check status on a different server:

hasura migrate status --admin-secret "<your-admin-secret>"

# Add Hasura GraphQL Server endpoint:
hasura migrate status --endpoint "<http-endpoint>"`,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
hasura migrate status --endpoint "<http-endpoint>"`,
hasura migrate status --endpoint "<endpoint>"`,

@hasura-bot
Copy link
Contributor

Review app for commit 453d195 deployed to Heroku: https://hge-ci-pull-3492.herokuapp.com
Docker image for server: hasura/graphql-engine:pull3492-453d1956

@marionschleifer marionschleifer added the c/docs Related to docs label Dec 6, 2019
Copy link
Member

@shahidhk shahidhk left a 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

@@ -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: `
Copy link
Member

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.

# 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:
Copy link
Member

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

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:
Copy link
Member

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.

@@ -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: `
Copy link
Member

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.

@@ -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: `
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indentation issues here too.

@hasura-bot
Copy link
Contributor

Review app for commit 8672d14 deployed to Heroku: https://hge-ci-pull-3492.herokuapp.com
Docker image for server: hasura/graphql-engine:pull3492-8672d144

@shahidhk shahidhk merged commit b183eba into hasura:master Dec 12, 2019
@hasura-bot
Copy link
Contributor

Review app https://hge-ci-pull-3492.herokuapp.com is deleted

@hasura-bot
Copy link
Contributor

Beep boop! 🤖

GIF

Awesome work @ashishra0! All of us at Hasura ❤️ what you did.

Thanks again 🤗

@shahidhk shahidhk added the c/cli Related to CLI label Dec 12, 2019
polRk pushed a commit to polRk/graphql-engine that referenced this pull request Feb 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c/cli Related to CLI c/docs Related to docs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants