cli
cli copied to clipboard
Scaffolder: Prevent having pointer field for a type that has a custom type fields
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];
}
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];
}
@aljo242 I propose we bump the priority of this issue. It should be reasonably straightforward to fix, and will significantly improve the scaffolding experience.