From 12a8fb9a32195241a917e373cf59a63c4a20a9f7 Mon Sep 17 00:00:00 2001 From: Yaacov Rydzinski Date: Mon, 12 Jul 2021 20:50:36 +0300 Subject: [PATCH] add changeset --- .changeset/quick-hotels-beam.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 .changeset/quick-hotels-beam.md diff --git a/.changeset/quick-hotels-beam.md b/.changeset/quick-hotels-beam.md new file mode 100644 index 00000000000..f37aa1f8814 --- /dev/null +++ b/.changeset/quick-hotels-beam.md @@ -0,0 +1,16 @@ +--- +'@graphql-tools/stitch': major +'@graphql-tools/stitching-directives': major +'@graphql-tools/utils': major +'@graphql-tools/wrap': major +--- + +fix(getDirectives): preserve order around repeatable directives + +BREAKING CHANGE: getDirectives now always return an array of individual DirectiveAnnotation objects consisting of `name` and `args` properties. + +New useful function `getDirective` returns an array of objects representing any args for each use of a single directive (returning the empty object `{}` when a directive is used without arguments). + +Note: The `getDirective` function returns an array even when the specified directive is non-repeatable. This is because one use of this function is to throw an error if more than one directive annotation is used for a non repeatable directive! + +When specifying directives in extensions, one can use either the old or new format.