loadRelated<T> method

Future<T> loadRelated<T>({
  1. required String entityName,
  2. required String entityId,
  3. required String fieldName,
  4. required String relatedType,
  5. String? queryName,
  6. bool? isNullable,
  7. bool isJoinType = false,
  8. Map<String, Object?>? fixedWhere,
})

Implementation

Future<T> loadRelated<T>(
    {required String entityName,
    required String entityId,
    required String fieldName,
    required String relatedType,
    String? queryName,
    bool? isNullable,
    bool isJoinType = false,
    Map<String, Object?>? fixedWhere}) async {
  isNullable ??= "$T".endsWith("?");
  final raw = await this.loadRelatedJson(
      entityName: entityName,
      entityId: entityId,
      fieldName: fieldName,
      relatedType: relatedType,
      fixedWhere: fixedWhere,
      queryName: queryName,
      isNullable: isNullable,
      isJoinType: isJoinType);
  return this._serializer.read<T>(
        raw,
        typeName: relatedType,
        isNullable: isNullable,
      );
}