Updating stash button locally on actor and scene page.
This commit is contained in:
@@ -12,6 +12,7 @@ const schemaExtender = makeExtendSchemaPlugin(_build => ({
|
||||
}
|
||||
|
||||
extend type Actor {
|
||||
isStashed: Boolean @requires(columns: ["stashesActors"])
|
||||
ageFromBirth: Int @requires(columns: ["dateOfBirth"])
|
||||
ageAtDeath: Int @requires(columns: ["dateOfBirth", "dateOfDeath"])
|
||||
height(units:Units): String @requires(columns: ["height"])
|
||||
@@ -22,6 +23,13 @@ const schemaExtender = makeExtendSchemaPlugin(_build => ({
|
||||
`,
|
||||
resolvers: {
|
||||
Actor: {
|
||||
isStashed(parent) {
|
||||
if (!parent['@stashes']) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return parent['@stashes'].length > 0;
|
||||
},
|
||||
ageFromBirth(parent, _args, _context, _info) {
|
||||
if (!parent.dateOfBirth) return null;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user