fetchToMany method

Future<RelationshipFetched<ToMany>> fetchToMany(
  1. String type,
  2. String id,
  3. String relationship, {
  4. Map<String, String> headers = const {},
  5. Map<String, String> query = const {},
})

Implementation

Future<RelationshipFetched<ToMany>> fetchToMany(
  String type,
  String id,
  String relationship, {
  Map<String, String> headers = const {},
  Map<String, String> query = const {},
}) async {
  final response = await send(
      baseUri.relationship(type, id, relationship),
      Request.get()
        ..headers.addAll(headers)
        ..query.addAll(query));
  return RelationshipFetched.many(
      response.http, response.document ?? (throw FormatException()));
}