Module: RuboCop::GraphQL::NodePattern
- Extended by:
- NodePattern::Macros
- Included in:
- Cop::GraphQL::ArgumentDescription, Cop::GraphQL::ArgumentName, Cop::GraphQL::ExtractInputType, Cop::GraphQL::ExtractType, Cop::GraphQL::FieldDefinitions, Cop::GraphQL::FieldDescription, Cop::GraphQL::FieldHashKey, Cop::GraphQL::FieldMethod, Cop::GraphQL::FieldName, Cop::GraphQL::MultipleFieldDefinitions, Cop::GraphQL::ObjectDescription, Cop::GraphQL::UnnecessaryArgumentCamelize, Cop::GraphQL::UnnecessaryFieldAlias, Cop::GraphQL::UnnecessaryFieldCamelize
- Defined in:
- lib/rubocop/graphql/node_pattern.rb
Instance Method Summary collapse
- #argument?(node) ⇒ Object
- #field?(node) ⇒ Boolean
- #field_definition?(node) ⇒ Object
- #field_definition_with_body?(node) ⇒ Object
Instance Method Details
#argument?(node) ⇒ Object
22 23 24 |
# File 'lib/rubocop/graphql/node_pattern.rb', line 22 def_node_matcher :argument?, <<~PATTERN (send nil? :argument (:sym _) ...) PATTERN |
#field?(node) ⇒ Boolean
26 27 28 |
# File 'lib/rubocop/graphql/node_pattern.rb', line 26 def field?(node) field_definition?(node) || field_definition_with_body?(node) end |
#field_definition?(node) ⇒ Object
9 10 11 |
# File 'lib/rubocop/graphql/node_pattern.rb', line 9 def_node_matcher :field_definition?, <<~PATTERN (send nil? :field (:sym _) ...) PATTERN |
#field_definition_with_body?(node) ⇒ Object
14 15 16 17 18 19 |
# File 'lib/rubocop/graphql/node_pattern.rb', line 14 def_node_matcher :field_definition_with_body?, <<~PATTERN (block (send nil? :field (:sym _) ...) ... ) PATTERN |