Skip to content

Commit

Permalink
fix(SyntheticReadAloud): add commit the derivative was generated from…
Browse files Browse the repository at this point in the history
… to graphql derivative type
  • Loading branch information
lucianak committed Oct 7, 2024
1 parent df0a4d4 commit 05ee9a9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@



module.exports = {
commit: async (derivative, args, context) => {
if (!(derivative?.commitId)) {
throw new Error('Could not find commit the derivative %s was generated from', derivative.id)
}
const dbCommit = await context.loaders.Commit.byId.load(derivative.commitId)
return dbCommit
}
}
2 changes: 2 additions & 0 deletions packages/backend-modules/publikator/graphql/schema-types.js
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,8 @@ type Derivative {
readyAt: DateTime
failedAt: DateTime
destroyedAt: DateTime
# commit the derivative was generated from
commit: Commit!
}
enum DerivativeType {
Expand Down

0 comments on commit 05ee9a9

Please sign in to comment.