ignite / cli

Ignite is a CLI tool and hub designed for constructing Proof of Stake Blockchains rooted in Cosmos-SDK
https://ignite.com
Other
1.24k stars 542 forks source link

Scaffolder: Prevent having pointer field for a type that has a custom type fields #1616

Open lumtis opened 2 years ago

lumtis commented 2 years ago

When scaffolding a type with a custom type field:

starport s type foo
starport s map bar foo:Foo 

The foo field will be a pointer. We should use the [(gogoproto.nullable) = false] option in proto field to avoid having a pointer

Generating

message Bar {
  string index = 1; 
  Foo foo = 2 [(gogoproto.nullable) = false];
}
fadeev commented 1 year ago

Same goes for scaffolding queries:

ignite s type comment body
ignite s query show-blog id --response comments:Comment 
// Currently:
message QueryShowBlogResponse {
  Comment comments = 1;
}
// Should be:
message QueryShowBlogResponse {
  Comment comments = 1 [(gogoproto.nullable) = false];
}
fadeev commented 1 year ago

@aljo242 I propose we bump the priority of this issue. It should be reasonably straightforward to fix, and will significantly improve the scaffolding experience.