Skip to content

Commit

Permalink
fix(merge): handle undefined interfaces array on ObjectTypeDefinition…
Browse files Browse the repository at this point in the history
…Node #2629
  • Loading branch information
ardatan committed May 11, 2021
1 parent 52971f4 commit eae2879
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/curvy-cups-help.md
@@ -0,0 +1,5 @@
---
'@graphql-tools/merge': patch
---

fix(merge): handle undefined interfaces array on ObjectTypeDefinitionNode #2629
6 changes: 3 additions & 3 deletions packages/merge/src/typedefs-mergers/merge-named-type-array.ts
Expand Up @@ -7,9 +7,9 @@ function alreadyExists(arr: ReadonlyArray<NamedTypeNode>, other: NamedTypeNode):
}

export function mergeNamedTypeArray(
first: ReadonlyArray<NamedTypeNode>,
second: ReadonlyArray<NamedTypeNode>,
config: Config
first: ReadonlyArray<NamedTypeNode> = [],
second: ReadonlyArray<NamedTypeNode> = [],
config: Config = {}
): NamedTypeNode[] {
const result = [...second, ...first.filter(d => !alreadyExists(second, d))];
if (config && config.sort) {
Expand Down

0 comments on commit eae2879

Please sign in to comment.