In order to retrieve all models that are related to a parent model, you can use query predicates with the query API:

```dart
import 'package:amplify_flutter/amplify_flutter.dart';

import 'models/ModelProvider.dart';

Future<void> fetchAllCommentsForPostId(String postId) async {
  try {
    final comments = await Amplify.DataStore.query(
      Comment.classType,
      where: Comment.POST.eq(postId),
    );
    safePrint('Comments: $comments');
  } on DataStoreException catch (e) {
    safePrint('Something went wrong querying posts: ${e.message}');
  }
}
```