Skip to content

Commit

Permalink
Add tests for merging the directives with the same name and arguments (
Browse files Browse the repository at this point in the history
…#6097)

* Add tests for merging the directives with the same name and arguments

* Fix test
  • Loading branch information
ardatan authored Apr 26, 2024
1 parent 596b089 commit c02eb60
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions packages/merge/tests/merge-typedefs.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1704,4 +1704,17 @@ describe('Merge TypeDefs', () => {
});
expect(reformulatedGraphQL).toBeSimilarString(schemaWithDescription);
});
it('merges the directives with the same name and same arguments', () => {
const directive = parse(/* GraphQL */ `
directive @link(
url: String!
as: String
import: [link__Import]
for: link__Purpose
) on SCHEMA
`);
const typeDefs = [directive, directive];
const merged = mergeTypeDefs(typeDefs);
expect(print(merged)).toBeSimilarString(print(directive));
});
});

0 comments on commit c02eb60

Please sign in to comment.