Skip to content

Commit

Permalink
dont use null in maybeValue
Browse files Browse the repository at this point in the history
fix type error in stacks
  • Loading branch information
marcushaddon committed Jun 22, 2023
1 parent 6bdd0c4 commit f8b66b9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion codegen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ generates:
avoidOptionals:
inputValue: true
customResolverFn: "(parent: TParent, args: TArgs, ctx: TContext, info: GraphQLResolveInfo) => ResolverTypeWrapper<any>"
maybeValue: "T | null | undefined"
maybeValue: "T | undefined"
useInstanceSignature: true
scalars: # TODO: check that this is indeed true
ID:
Expand Down
5 changes: 4 additions & 1 deletion src/core/server/stacks/helpers/updateAllCommentCounts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,10 @@ export const calculateTags = (
};

let total = 0;
for (const [, value] of Object.entries(tags)) {
const values = Object.values(tags).filter(
(v) => typeof v !== "number"
) as number[];
for (const value of values) {
total += value;
}

Expand Down

0 comments on commit f8b66b9

Please sign in to comment.