Updating stash button locally on actor and scene page.

This commit is contained in:
DebaucheryLibrarian
2021-03-20 18:12:06 +01:00
parent bb949e0a3b
commit 07643870cd
6 changed files with 60 additions and 32 deletions

View File

@@ -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;