19 Commits

Author SHA1 Message Date
Javi Martín
0b1cfcd5da Upgrade to Rails 7.1
We're disabling `action_controller.raise_on_missing_callback_actions`
because sometimes we include `before_action :something, only: actions`
in concerns, and we include these concerns in controllers that don't
have all these actions.

Note that Rails 7.1 logs to STDOUT by default [1]; we're re-adding the
condition `if ENV["RAILS_LOG_TO_STDOUT"].present?` because we're still
using files and we're rotating the logs to avoid running out of space.

Also note that the GraphQL controller test (which is actually a request
test, since it's got `type: :request`) that was raising an exception no
longer does it thanks to the new default value for the
`config.action_dispatch.show_exceptions` configuration option. So we're
updating the test accordingly. This option doesn't affect regular
controller tests (without the `type: :request` option), so in other
tests we're still checking exceptions.

[1] Pull request 47138 in https://github.com/rails/rails
2025-05-20 13:12:29 +02:00
Javi Martín
3eaa40892d Extract method in GraphQL controller test
This way we remove a bit of duplication and it makes it easier to add
proper requests to other tests, which we're about to do.
2025-05-20 13:12:29 +02:00
dependabot[bot]
e7f6e39679 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>
2024-10-30 14:04:59 +01:00
taitus
62e85df83b Correctly check that the value of data is nil
The way we access "data" always returned nil
2024-10-30 14:03:51 +01:00
Javi Martín
2951d0fdf8 Add and apply Rails/ResponseParsedBody rubocop rule
This rule was introduced in rubocop-rails 2.18.0.

Since using `response.parsed_body` is shorter than using
`JSON.parse(response.body)`, this also means we can group some lines in
one.
2023-09-06 19:00:39 +02:00
Juanjo Bazán
0063e7b4d8 Add feature flag for the GraphQL API 2019-10-20 14:52:07 +02:00
Julian Herrero
6e88031537 Fix several rubocop warnings
Metrics/LineLength: Line is too long.
RSpec/InstanceVariable: Use let instead of an instance variable.
Layout/TrailingBlankLines: Final newline missing.
Style/StringLiterals: Prefer double-quoted strings.
2019-04-17 17:40:56 +02:00
Juanjo Bazán
0f34cae2ad updates specs to new keyword styles 2019-04-17 17:40:55 +02:00
Javi Martín
2b4e1cf358 Add missing double quotes
We overlooked a few single quotes while we changed thousands of them.
2019-03-25 13:22:35 +01:00
Julian Herrero
31ac8b7f55 Change single quotes to double quotes 2019-02-15 11:40:39 +01:00
Bertocq
2fa92937d2 Fix all Style/BracesAroundHashParameters rubocop issues and remove them from rubocop_todo list 2017-06-28 14:12:51 +02:00
Alberto Miedes Garcés
cad66ea85a Update GraphQL and GraphiQL gem 2017-05-11 22:29:21 +02:00
Alberto Miedes Garcés
70a1dbde94 Fix bug when parsing query variables sent by the GraphiQL desktop client 2017-01-31 13:52:25 +01:00
Alberto Miedes Garcés
6013f84945 Handle multiple kind of requests in GraphQL controller
* Added support for GET requests
* Added support for application/graphql content-type for POST requests
* Handling query string parsing errors in controller
* Wrote specs for all this
2016-12-03 13:36:14 +01:00
Alberto Miedes Garcés
a516262724 Example graphql_controller test 2016-11-30 13:43:50 +01:00
Alberto Miedes Garcés
0eae2fada6 Refactor GraphQL controller specs 2016-11-27 13:50:01 +01:00
Alberto Miedes Garcés
9ed51cf477 Useless commit 2016-11-25 01:02:05 +01:00
Alberto Miedes Garcés
2271f6d634 Renamed GraphQL route, added support for GET requests 2016-11-22 15:22:27 +01:00
Alberto Miedes Garcés
90d5034174 Half-made tests for GraphqlController 2016-11-17 17:47:09 +01:00