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

implemented issue #3346 #1

Merged
merged 2 commits into from
Dec 30, 2022
Merged
Show file tree
Hide file tree
Changes from all 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
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

### Changes

- [#3346](https://github.com/ignite/cli/issues/3346) Improve scaffold query --help
- [#3305](https://github.com/ignite/cli/pull/3305) Bump Cosmos SDK version to `v0.46.7`.
- [#3068](https://github.com/ignite/cli/pull/3068) Add configs to generated TS code for working with JS projects
- [#3071](https://github.com/ignite/cli/pull/3071) Refactor `ignite/templates` package.
Expand Down
22 changes: 22 additions & 0 deletions ignite/cmd/scaffold.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,28 @@ const (
msgCommitPrompt = "Do you want to proceed without committing your saved changes"

statusScaffolding = "Scaffolding..."

supportFieldTypes = `
Currently supports:

| Type | Alias | Index | Code Type | Description |
|--------------|---------|-------|-----------|---------------------------------|
| string | - | yes | string | Text type |
| array.string | strings | no | []string | List of text type |
| bool | - | yes | bool | Boolean type |
| int | - | yes | int32 | Integer type |
| array.int | ints | no | []int32 | List of integers types |
| uint | - | yes | uint64 | Unsigned integer type |
| array.uint | uints | no | []uint64 | List of unsigned integers types |
| coin | - | no | sdk.Coin | Cosmos SDK coin type |
| array.coin | coins | no | sdk.Coins | List of Cosmos SDK coin types |

Field Usage:
- fieldName
- fieldName:fieldType

If no :fieldType, default (string) is used
`
)

// NewScaffold returns a command that groups scaffolding related sub commands.
Expand Down
6 changes: 4 additions & 2 deletions ignite/cmd/scaffold_query.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ const (
// NewScaffoldQuery command creates a new type command to scaffold queries.
func NewScaffoldQuery() *cobra.Command {
c := &cobra.Command{
Use: "query [name] [request_field1] [request_field2] ...",
Short: "Query for fetching data from a blockchain",
Use: "query [name] [request_field1] [request_field2:field2_type] ...",
Short: "Query for fetching data from a blockchain\n",
Long: fmt.Sprintf("Query for fetching data from a blockchain\n%s\n", supportFieldTypes),
Example: " ignite scaffold map todo-item priority:int desc:string tags:array.string done:bool",
Args: cobra.MinimumNArgs(1),
PreRunE: gitChangesConfirmPreRunHandler,
RunE: queryHandler,
Expand Down