Skip to content

Commit

Permalink
Merge pull request #57 from cocoahero/add-path-to-directive-argument-…
Browse files Browse the repository at this point in the history
…added

Add support for `path` on `DirectiveArgumentAdded`.
  • Loading branch information
swalkinshaw authored Oct 27, 2023
2 parents 2f83c61 + 6dc3667 commit 32f5dea
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/graphql/schema_comparator/changes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1086,6 +1086,10 @@ def initialize(directive, argument)
def message
"Argument `#{argument.graphql_name}` was added to directive `#{directive.graphql_name}`"
end

def path
["@#{directive.graphql_name}", argument.graphql_name].join('.')
end
end
end
end
Expand Down
10 changes: 10 additions & 0 deletions test/lib/graphql/schema_comparator/diff/directive_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,15 @@ def test_diff
"Default value for argument `a` on directive `Default` changed from `No` to `Yes`",
"Type for argument `a` on directive `Default` changed from `Int!` to `String!`"
], differ.diff.map(&:message)

assert_equal [
"@Default",
"@Default",
"@Default.c",
"@Default.b",
"@Default.a",
"@Default.a",
"@Default.a"
], differ.diff.map(&:path)
end
end

0 comments on commit 32f5dea

Please sign in to comment.