You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When generating the client from the protobuf file where a variable has type float, the client throws an error stating that the field in question doesn't exist. Also when reviewing the output of the generated files, I'm seeing that the client is generating an entire new resolver based on the object the float is associated with.
// filename: api.proto
service API {
rpc GetSomething(GetSomethingRequest) returns (GetSomethingResponse);
}
message GetSomethingRequest {
int64 id = 1;
}
message GetSomethingResponse {
int64 id = 1;
string name = 2;
repeated Something;
}
message Something {
int64 id = 1;
float density = 2; // type float associated to "Something" object
}
// Error message received when generating from this
panic: validation failed: packages.Load: /app/twirpql/resolver.go:132:15: r.API.Density undefined (type mySomething.API has no field or method Density)
/app/twirpql/resolver.go:132:28: undeclared name: req
// filename: resolver.go
// New resolver added here (this is similar in `generated.go`)
...
func (r *Resolver) Something() SomethingResolver {
return &somethingResolver{r}
}
...
type somethingResolver struct{ *Resolver }
func (r *somethingResolver) Density(ctx context.Context, obj *api.Something) (float64, error) {
return r.API.Density(ctx, req)
}
...
The text was updated successfully, but these errors were encountered:
When generating the client from the protobuf file where a variable has type
float
, the client throws an error stating that the field in question doesn't exist. Also when reviewing the output of the generated files, I'm seeing that the client is generating an entire new resolver based on the object the float is associated with.The text was updated successfully, but these errors were encountered: