Skip to content

Commit

Permalink
found bug in id generate
Browse files Browse the repository at this point in the history
  • Loading branch information
aexol committed Jan 20, 2024
1 parent 1fb43f2 commit f6df5a6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "graphql-js-tree",
"version": "1.0.8",
"version": "1.0.9",
"private": false,
"license": "MIT",
"description": "GraphQL Parser providing simplier structure",
Expand Down
2 changes: 1 addition & 1 deletion src/TreeOperations/merge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ const mergeNode = (n1: ParserField, n2: ParserField) => {
const args = [...n1.args, ...n2.args.map(addFromLibrary)];
const mergedNode = {
...n1,
id: generateNodeId(n1.name, n1.data.type, args),
args,
directives: [...n1.directives, ...n2.directives.map(addFromLibrary)],
interfaces: [...n1.interfaces, ...n2.interfaces],
} as ParserField;
mergedNode.id = generateNodeId(mergeNode.name, mergedNode.data.type, mergedNode.args);
//dedupe
mergedNode.args = mergedNode.args.filter((a, i) => mergedNode.args.findIndex((aa) => aa.name === a.name) === i);
mergedNode.directives = mergedNode.directives.filter(
Expand Down

0 comments on commit f6df5a6

Please sign in to comment.