FieldPolicy.fromJson constructor

FieldPolicy.fromJson(
  1. Object? j
)

Implementation

factory FieldPolicy.fromJson(Object? j) {
  final json = j as Map<String, Object?>;
  return FieldPolicy(
    selector: switch (json['selector']) {
      null => '',
      Object $1 => decodeString($1),
    },
    resourcePermission: switch (json['resourcePermission']) {
      null => '',
      Object $1 => decodeString($1),
    },
    resourceType: switch (json['resourceType']) {
      null => '',
      Object $1 => decodeString($1),
    },
  );
}