From 82ece57cf80dd8d9850b31ce1dda83474e0e563d Mon Sep 17 00:00:00 2001 From: Michael Chase <3686226+reallistic@users.noreply.github.com> Date: Wed, 16 Oct 2024 20:28:58 -0400 Subject: [PATCH] fix parsing of repeatable directives when cleaning up the sdl --- ariadne/contrib/federation/utils.py | 2 +- tests/federation/test_utils.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ariadne/contrib/federation/utils.py b/ariadne/contrib/federation/utils.py index bb6bc1d83..248b4bb30 100644 --- a/ariadne/contrib/federation/utils.py +++ b/ariadne/contrib/federation/utils.py @@ -29,7 +29,7 @@ f"{_i_token_delimiter}directive" f"(?:{_i_token_delimiter})?@({_i_token_name})" f"(?:(?:{_i_token_delimiter})?{_i_token_arguments})?" - f"{_i_token_delimiter}on" + f"{_i_token_delimiter}(?:repeatable)?(?:{_i_token_delimiter})?on" f"{_i_token_delimiter}(?:[|]{_i_token_delimiter})?{_i_token_location}" f"(?:{_i_token_delimiter}[|]{_i_token_delimiter}{_i_token_location})*" ")" diff --git a/tests/federation/test_utils.py b/tests/federation/test_utils.py index d6ef51ef5..faba0b10d 100644 --- a/tests/federation/test_utils.py +++ b/tests/federation/test_utils.py @@ -63,6 +63,8 @@ def test_purge_directives_remove_custom_directives(): directive @another on FIELD + directive @plural repeatable on FIELD + type Query { field1: String @custom field2: String @other