diff options
Diffstat (limited to 'rubocop/cop/graphql/descriptions.rb')
-rw-r--r-- | rubocop/cop/graphql/descriptions.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/rubocop/cop/graphql/descriptions.rb b/rubocop/cop/graphql/descriptions.rb index ec233c65874..520e34dcd16 100644 --- a/rubocop/cop/graphql/descriptions.rb +++ b/rubocop/cop/graphql/descriptions.rb @@ -54,6 +54,10 @@ module RuboCop (send nil? :value ...) PATTERN + def_node_matcher :resolver_kwarg, <<~PATTERN + (... (hash <(pair (sym :resolver) $_) ...>)) + PATTERN + def_node_matcher :description_kwarg, <<~PATTERN (... (hash <(pair (sym :description) $_) ...>)) PATTERN @@ -64,6 +68,7 @@ module RuboCop def on_send(node) return unless graphql_describable?(node) + return if resolver_kwarg(node) # Fields may inherit the description from their resolvers. description = locate_description(node) |