forked from DebaucheryLibrarian/traxxx
Added profile interpolation.
This commit is contained in:
@@ -12,7 +12,7 @@ const schemaExtender = makeExtendSchemaPlugin(_build => ({
|
||||
}
|
||||
|
||||
extend type Actor {
|
||||
age: Int @requires(columns: ["date_of_birth"])
|
||||
age: Int @requires(columns: ["dateOfBirth"])
|
||||
height(units:Units): String @requires(columns: ["height"])
|
||||
weight(units:Units): String @requires(columns: ["weight"])
|
||||
}
|
||||
@@ -20,9 +20,9 @@ const schemaExtender = makeExtendSchemaPlugin(_build => ({
|
||||
resolvers: {
|
||||
Actor: {
|
||||
age(parent, _args, _context, _info) {
|
||||
if (!parent.birthdate) return null;
|
||||
if (!parent.dateOfBirth) return null;
|
||||
|
||||
return moment().diff(parent.birthdate, 'years');
|
||||
return moment().diff(parent.dateOfBirth, 'years');
|
||||
},
|
||||
height(parent, args, _context, _info) {
|
||||
if (!parent.height) return null;
|
||||
|
||||
Reference in New Issue
Block a user