Skip to content

Commit

Permalink
fix(HoistField): handle list fields correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
ardatan committed Nov 30, 2022
1 parent 4592a2a commit 02126e6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/clever-toys-wonder.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@graphql-tools/wrap': patch
---

Fix handling nested list fields in HoistField
2 changes: 1 addition & 1 deletion packages/wrap/src/transforms/HoistField.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ export default class HoistField<TContext extends Record<string, any> = Record<st
newTargetField.resolve = (parent, args, context, info) =>
Promise.all(
Object.keys(parent)
.filter(key => !key.startsWith('__'))
.filter(key => !isNaN(parseInt(key, 10)))
.map(key => resolver(parent[key], args, context, info))
);
}
Expand Down

0 comments on commit 02126e6

Please sign in to comment.