Class: RuboCop::Cop::Mable::NoPostInGraphQL
- Inherits:
-
Base
- Object
- Base
- RuboCop::Cop::Mable::NoPostInGraphQL
- Extended by:
- AutoCorrector
- Defined in:
- lib/rubocop/cop/mable/no_post_in_graph_ql.rb
Overview
Enforces using a direct helper method over ‘post` for executing GraphQL queries, incorporating user authentication context when applicable.
Constant Summary collapse
- MSG =
"Use 'ReplacePostWith' default: `make_graphql_request` directly instead of `post` for GraphQL requests, incorporating user context."- RESTRICT_ON_SEND =
i[post].freeze
Instance Method Summary collapse
Instance Method Details
#on_send(node) ⇒ Object
50 51 52 53 54 |
# File 'lib/rubocop/cop/mable/no_post_in_graph_ql.rb', line 50 def on_send(node) post_graphql?(node) do |path| handle_post_graphql(node) if graphql_path_allowed?(path) end end |