diff options
Diffstat (limited to 'rubocop/graphql_helpers.rb')
-rw-r--r-- | rubocop/graphql_helpers.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/rubocop/graphql_helpers.rb b/rubocop/graphql_helpers.rb new file mode 100644 index 00000000000..eef83df0112 --- /dev/null +++ b/rubocop/graphql_helpers.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module RuboCop + module GraphqlHelpers + TYPES_DIR = 'app/graphql/types' + + def in_type?(node) + path = node.location.expression.source_buffer.name + + path.include?(TYPES_DIR) + end + end +end |