Query function of a chaincode is called, the fabric passes the
stub *shim.ChaincodeStub parameter. This
stub can be used to call APIs to access to the ledger services, transaction context, or to invoke other chaincodes.
The current APIs are defined in the shim package, generated by
godoc. However, it includes functions from chaincode.pb.go such as
func (*Column) XXX_OneofFuncs that are not intended as public API. The best is to look at the function definitions in chaincode.go and chaincode samples for usage.