Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
alessbell committed Dec 11, 2024
1 parent e10aa61 commit 3f983b2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/utilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,11 @@ function createDefaultResolvers(typesMap: Map<string, Set<string>>) {
for (const key of typesMap.keys()) {
defaultResolvers[key] = {
__resolveType(data) {
return data.__typename || typesMap.get(key)?.values().next().value;
return (
// fallback to an empty string here to satisfy TS, since
// all keys in typesMap should have '
data.__typename || typesMap.get(key)?.values().next().value || ""
);
},
};
}
Expand Down

1 comment on commit 3f983b2

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lines Statements Branches Functions
Coverage: 95%
94.89% (130/137) 87.8% (36/41) 85.71% (30/35)
Tests Skipped Failures Errors Time
7 0 💤 0 ❌ 0 🔥 3.608s ⏱️
Coverage Report (95%)
File% Stmts% Branch% Funcs% LinesUncovered Line #s
All files94.8987.885.7195.52 
   handlers.ts94.3193.7585.7194.18150–163
   utilities.ts95.918485.7197.91124

Please sign in to comment.