gqlifyField<T> function
Reads json[key] with decoder, adding key to the path of failures.
Implementation
T gqlifyField<T>(
Map<String, Object?> json, String key, GqlifyDecoder<T> decoder) {
try {
return decoder.decode(json[key]);
} on GqlifyDecodeError catch (e) {
throw e._at(key, missing: !json.containsKey(key));
}
}