Switched to tabs. Adding missing actor entries when scraping actors, with batch ID.
This commit is contained in:
@@ -5,7 +5,7 @@ const moment = require('moment');
|
||||
const { cmToFeetInches, kgToLbs } = require('../../utils/convert');
|
||||
|
||||
const schemaExtender = makeExtendSchemaPlugin(_build => ({
|
||||
typeDefs: gql`
|
||||
typeDefs: gql`
|
||||
enum Units {
|
||||
METRIC
|
||||
IMPERIAL
|
||||
@@ -17,32 +17,32 @@ const schemaExtender = makeExtendSchemaPlugin(_build => ({
|
||||
weight(units:Units): String @requires(columns: ["weight"])
|
||||
}
|
||||
`,
|
||||
resolvers: {
|
||||
Actor: {
|
||||
age(parent, _args, _context, _info) {
|
||||
if (!parent.birthdate) return null;
|
||||
resolvers: {
|
||||
Actor: {
|
||||
age(parent, _args, _context, _info) {
|
||||
if (!parent.birthdate) return null;
|
||||
|
||||
return moment().diff(parent.birthdate, 'years');
|
||||
},
|
||||
height(parent, args, _context, _info) {
|
||||
if (!parent.height) return null;
|
||||
return moment().diff(parent.birthdate, 'years');
|
||||
},
|
||||
height(parent, args, _context, _info) {
|
||||
if (!parent.height) return null;
|
||||
|
||||
if (args.units === 'IMPERIAL') {
|
||||
const { feet, inches } = cmToFeetInches(parent.height);
|
||||
return `${feet}' ${inches}"`;
|
||||
}
|
||||
if (args.units === 'IMPERIAL') {
|
||||
const { feet, inches } = cmToFeetInches(parent.height);
|
||||
return `${feet}' ${inches}"`;
|
||||
}
|
||||
|
||||
return parent.height.toString();
|
||||
},
|
||||
weight(parent, args, _context, _info) {
|
||||
if (!parent.weight) return null;
|
||||
return parent.height.toString();
|
||||
},
|
||||
weight(parent, args, _context, _info) {
|
||||
if (!parent.weight) return null;
|
||||
|
||||
return args.units === 'IMPERIAL'
|
||||
? kgToLbs(parent.weight).toString()
|
||||
: parent.weight.toString();
|
||||
},
|
||||
},
|
||||
},
|
||||
return args.units === 'IMPERIAL'
|
||||
? kgToLbs(parent.weight).toString()
|
||||
: parent.weight.toString();
|
||||
},
|
||||
},
|
||||
},
|
||||
}));
|
||||
|
||||
module.exports = [schemaExtender];
|
||||
|
||||
Reference in New Issue
Block a user