Skip to content

Commit a6a7d0b

Browse files
committed
fix: metadata storage refactor caused a bug in field resolver
When creating a field resolver with an input we reached a bad edge case where the fields array was fetched via reference instead of an immutable array. This caused artifacts appearing in the array and bad metadata appeared when trying to parse the schema. Returning a new array from the metadata instead of the reference for the existing array solves this issue
1 parent 1ea0fea commit a6a7d0b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/graphql/lib/schema-builder/collections/metadata-by-name.collection.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ export class MetadataByNameCollection<T> {
33
protected all: (T extends any[] ? T[number] : T)[] = [];
44

55
getAll() {
6-
return this.all;
6+
return [...this.all];
77
}
88

99
getByName(name: string) {

0 commit comments

Comments
 (0)