Hi,
I’m trying to define a query function to call from within another actor using composite queries:
public composite query func getLeagues() : async Result.Result<[DTOs.FootballLeagueDTO], T.Error> {
let data_canister = actor (NetworkEnvVars.DATA_CANISTER_ID) : actor {
getLeagues : shared query () -> async Result.Result<[T.FootballLeague], T.Error>;
};
return await data_canister.getLeagues();
};
But I get the error a shared function is only allowed as a public field of an actor
.
I’m thinking it is because of how my file structure is, I have an actor that calls a module containing my data manager class:
module {
public class DataManager() {
Full file here: