forked from DebaucheryLibrarian/traxxx
Added Bang! actor scraper. Fixed date interpolation. Showing date and age of death on profile (only if actor has already died).
This commit is contained in:
@@ -13,6 +13,7 @@ const schemaExtender = makeExtendSchemaPlugin(_build => ({
|
||||
|
||||
extend type Actor {
|
||||
age: Int @requires(columns: ["dateOfBirth"])
|
||||
ageAtDeath: Int @requires(columns: ["dateOfBirth", "dateOfDeath"])
|
||||
height(units:Units): String @requires(columns: ["height"])
|
||||
weight(units:Units): String @requires(columns: ["weight"])
|
||||
}
|
||||
@@ -24,6 +25,11 @@ const schemaExtender = makeExtendSchemaPlugin(_build => ({
|
||||
|
||||
return moment().diff(parent.dateOfBirth, 'years');
|
||||
},
|
||||
ageAtDeath(parent, _args, _context, _info) {
|
||||
if (!parent.dateOfDeath) return null;
|
||||
|
||||
return moment(parent.dateOfDeath).diff(parent.dateOfBirth, 'years');
|
||||
},
|
||||
height(parent, args, _context, _info) {
|
||||
if (!parent.height) return null;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user