Bump graphql from 2.0.31 to 2.3.18
Note: The parser error message format changed in GraphQL 2.2.0 due to the introduction of a new optimized lexer and a hand-written parser (PR 4718). This commit updates the `parser_error_raised?` method in the GraphqlController tests to correctly detect errors using the new message format. The previous pattern was checking for "Parse error on", but with the new version, the error message now contains "Expected one of". This change ensures that the tests for malformed queries continue to pass as expected. Bumps [graphql](https://github.com/rmosolgo/graphql-ruby) from 2.0.31 to 2.3.18. - [Release notes](https://github.com/rmosolgo/graphql-ruby/releases) - [Changelog](https://github.com/rmosolgo/graphql-ruby/blob/master/CHANGELOG.md) - [Commits](https://github.com/rmosolgo/graphql-ruby/compare/v2.0.31...v2.3.18) --- updated-dependencies: - dependency-name: graphql dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
This commit is contained in:
2
Gemfile
2
Gemfile
@@ -27,7 +27,7 @@ gem "foundation_rails_helper", "~> 4.0.1"
|
||||
gem "globalize", "~> 6.3.0"
|
||||
gem "globalize-accessors", "~> 0.3.0"
|
||||
gem "graphiql-rails", "~> 1.8.0"
|
||||
gem "graphql", "~> 2.0.0"
|
||||
gem "graphql", "~> 2.3.18"
|
||||
gem "groupdate", "~> 6.5.1"
|
||||
gem "image_processing", "~> 1.13.0"
|
||||
gem "invisible_captcha", "~> 2.3.0"
|
||||
|
||||
@@ -228,6 +228,7 @@ GEM
|
||||
faraday-net_http (3.3.0)
|
||||
net-http
|
||||
ffi (1.17.0)
|
||||
fiber-storage (1.0.0)
|
||||
file_validators (3.0.0)
|
||||
activemodel (>= 3.2)
|
||||
mime-types (>= 1.0)
|
||||
@@ -255,8 +256,9 @@ GEM
|
||||
graphiql-rails (1.8.0)
|
||||
railties
|
||||
sprockets-rails
|
||||
graphql (2.0.31)
|
||||
graphql (2.3.18)
|
||||
base64
|
||||
fiber-storage
|
||||
groupdate (6.5.1)
|
||||
activesupport (>= 7)
|
||||
gyoku (1.4.0)
|
||||
@@ -740,7 +742,7 @@ DEPENDENCIES
|
||||
globalize (~> 6.3.0)
|
||||
globalize-accessors (~> 0.3.0)
|
||||
graphiql-rails (~> 1.8.0)
|
||||
graphql (~> 2.0.0)
|
||||
graphql (~> 2.3.18)
|
||||
groupdate (~> 6.5.1)
|
||||
i18n-tasks (~> 0.9.37)
|
||||
image_processing (~> 1.13.0)
|
||||
|
||||
@@ -2,12 +2,6 @@ require "rails_helper"
|
||||
|
||||
# Useful resource: http://graphql.org/learn/serving-over-http/
|
||||
|
||||
def parser_error_raised?(response)
|
||||
data_is_empty = response.parsed_body["data"].nil?
|
||||
error_is_present = (JSON.parse(response.body)["errors"].first["message"] =~ /^Parse error on/)
|
||||
data_is_empty && error_is_present
|
||||
end
|
||||
|
||||
describe GraphqlController, type: :request do
|
||||
let(:proposal) { create(:proposal) }
|
||||
|
||||
@@ -23,7 +17,8 @@ describe GraphqlController, type: :request do
|
||||
get "/graphql", params: { query: "Malformed query string" }
|
||||
|
||||
expect(response).to have_http_status(:ok)
|
||||
expect(parser_error_raised?(response)).to be_truthy
|
||||
expect(response.parsed_body["data"]).to be nil
|
||||
expect(response.parsed_body["errors"]).to be_present
|
||||
end
|
||||
|
||||
specify "without query string" do
|
||||
@@ -58,7 +53,8 @@ describe GraphqlController, type: :request do
|
||||
post "/graphql", params: { query: "Malformed query string" }.to_json, headers: json_headers
|
||||
|
||||
expect(response).to have_http_status(:ok)
|
||||
expect(parser_error_raised?(response)).to be_truthy
|
||||
expect(response.parsed_body["data"]).to be nil
|
||||
expect(response.parsed_body["errors"]).to be_present
|
||||
end
|
||||
|
||||
it "without query string" do
|
||||
|
||||
Reference in New Issue
Block a user