Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion graphql-client.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Gem::Specification.new do |s|
s.add_development_dependency "minitest", "~> 5.9"
s.add_development_dependency "rake", "~> 13.2.1"
s.add_development_dependency "rubocop-github"
s.add_development_dependency "rubocop", "~> 1.66.1"
s.add_development_dependency "rubocop", "~> 1.73.2"

s.required_ruby_version = ">= 2.1.0"

Expand Down
6 changes: 3 additions & 3 deletions lib/rubocop/cop/graphql/heredoc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module RuboCop
module Cop
module GraphQL
# Public: Cop for enforcing non-interpolated GRAPHQL heredocs.
class Heredoc < Cop
class Heredoc < Base
def on_dstr(node)
check_str(node)
end
Expand All @@ -19,11 +19,11 @@ def check_str(node)
return unless node.location.expression.source =~ /^<<(-|~)?GRAPHQL/

node.each_child_node(:begin) do |begin_node|
add_offense(begin_node, location: :expression, message: "Do not interpolate variables into GraphQL queries, " \
add_offense(begin_node, message: "Do not interpolate variables into GraphQL queries, " \
"used variables instead.")
end

add_offense(node, location: :expression, message: "GraphQL heredocs should be quoted. <<-'GRAPHQL'")
add_offense(node, message: "GraphQL heredocs should be quoted. <<-'GRAPHQL'")
end

def autocorrect(node)
Expand Down
4 changes: 2 additions & 2 deletions lib/rubocop/cop/graphql/overfetch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module RuboCop
module Cop
module GraphQL
# Public: Rubocop for catching overfetched fields in ERB templates.
class Overfetch < Cop
class Overfetch < Base
if defined?(RangeHelp)
# rubocop 0.53 moved the #source_range method into this module
include RangeHelp
Expand Down Expand Up @@ -42,7 +42,7 @@ def investigate(processed_source)

visitor.fields.each do |field, count|
next if count > 0
add_offense(nil, location: visitor.ranges[field], message: "GraphQL field '#{field}' query but was not used in template.")
add_offense(nil, message: "GraphQL field '#{field}' query but was not used in template.")
end
end

Expand Down
2 changes: 1 addition & 1 deletion test/test_client_errors.rb
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ def test_errors_collection
"errors" => [
{
"message" => "b00m",
"locations" => [{"line" => 1, "column" => 3}],
"locations" => [{ "line" => 1, "column" => 3 }],
"path" => ["nullableError"]
}
]
Expand Down
2 changes: 1 addition & 1 deletion test/test_client_schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def test_dump_schema_io

def test_dump_schema_context
conn = FakeConn.new
GraphQL::Client.dump_schema(conn, StringIO.new, context: { user_id: 1})
GraphQL::Client.dump_schema(conn, StringIO.new, context: { user_id: 1 })
assert_equal({ user_id: 1 }, conn.context)
end
end
2 changes: 1 addition & 1 deletion test/test_query_result.rb
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ def test_snakecase_field_aliases
GRAPHQL

person = Temp::Person.new(@client.query(Temp::Query).data.me)
raw_result = {"firstName"=>"Joshua", "lastName"=>"Peek"}
raw_result = { "firstName" => "Joshua", "lastName" => "Peek" }
assert_equal raw_result, person.to_h
assert_equal raw_result, person.to_hash

Expand Down
Loading