Following the tutorial, there is the query
query selectCommoditiesByOwner {
description: "Select all commodities based on their owner"
statement:
SELECT org.acme.biznet.Commodity
WHERE (owner == _$owner)
}
But nowhere is an example explaining how to request it
For the parameter owner
, I tryed with the node variable owner
owner.toUri()
owner.getFullyQualifiedIdentifier()
"resource:" + owner.getFullyQualifiedIdentifier()
But nothing works
Does somebody has a working example?
Example on how to 'request it' is shown in the REST API section of the Queries tutorial https://hyperledger.github.io/composer/tutorials/queries
If you mean: request it from within a Transaction Processor function, using the APIs - there is an example in the same tutorial, of calling a Query function eg.
so using your query - you might do something like:
hope this helps. See further reference here -> https://hyperledger.github.io/composer//reference/query-language