query method
Future<QueryResponse>
query(
- Principal canisterId,
- QueryFields fields,
- Identity? identity
override
Send a query call to a canister. See the interface spec. @param canisterId The Principal of the Canister to send the query to. Sending a query to the management canister is not supported (as it has no meaning from an agent). @param options Options to use to create and send the query. @returns The response from the replica. The Promise will only reject when the communication failed. If the query itself failed but no protocol errors happened, the response will be of type QueryResponseRejected.
Implementation
@override
Future<QueryResponse> query(
Principal canisterId,
QueryFields fields,
Identity? identity,
) {
return _sendAndWait(
ProxyMessageQueryResponse.fromJson({
'id': _nextId++,
'type': ProxyMessageKind.query,
'args': [canisterId.toString(), fields],
}),
);
}