Skip to content

Commit

Permalink
fix: metadata storage refactor caused a bug in field resolver
Browse files Browse the repository at this point in the history
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
  • Loading branch information
roypeled committed Mar 19, 2023
1 parent 1ea0fea commit a6a7d0b
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ export class MetadataByNameCollection<T> {
protected all: (T extends any[] ? T[number] : T)[] = [];

getAll() {
return this.all;
return [...this.all];
}

getByName(name: string) {
Expand Down

0 comments on commit a6a7d0b

Please sign in to comment.