Grpc request report a error

can not invoke a grpc request

script.js

const data = {"pageSize":10,"page":1,"sorted":[{"id":"id","desc":false}]};
const response = client.invoke("hello.Hello/helloquery", data);
console.log(JSON.stringify(response));

query.proto

message Query {
	int32 pageSize =  "pageSize";
	int32 page = "page";
	bytes sorted = "sorted";
}

goerror

ERRO[0000] GoError: unable to serialise request object to protocol buffer: proto: (line 1:34): invalid value for bytes type: [
running at github.com/loadimpact/k6/js/common.Bind.func1 (native)

You have bytes sorted = "sorted";, so maybe have data be something like this:

data = {"pageSize":10,"page":1,"sorted":JSON.stringify([{"id":"id","desc":false}])};

Or if not JSON-encoded, encode the array in the way you expect to receive it from the server?