I have a project I would like to query datas from several object whose got inner object with @hasOne relation but wheneever I try to query these data, I got and Exception that these fields are not populated.
class AppTournament extends amplify_core.Model {
static const classType = const _AppTournamentModelType();
final String id;
final String? _name;
final Tournament? _real_tournament;
final User? _founder;
final amplify_core.TemporalDateTime? _createdAt;
final amplify_core.TemporalDateTime? _updatedAt;
final String? _appTournamentReal_tournamentId;
final String? _appTournamentFounderId; } for example here I dont receive the fouder nor the tournament object when I do a query. I need to enable somewhere the prepropulation of these datas ?
Future<List<AppTournament>> getAppTournaments2() async {
final value = await Amplify.DataStore.query(AppTournament.classType);
for (var i in value) {
i.founder;
}
return value;
},
This will throw an exception.
type AppTournament @model @auth(rules: [{allow: public}]) {
id: ID!
name: String!
real_tournament: Tournament! @hasOne
founder: User! @hasOne
}
this is the scheme.
Feel free to ask!
Hi, Zoli!