feat: Add support for Rails 8, Ruby 3, and latest GraphQL gem#21
Merged
feat: Add support for Rails 8, Ruby 3, and latest GraphQL gem#21
Conversation
* feat: drop old ruby; remove appraisals * ruby 3.4 fix * Fix
* Try new protobuf * Cop * Bump version
Co-authored-by: Bajena <jan.bajena@productboard.com>
* Fix tracer crash with graphql-ruby 2.5.12+ (Gusto#297) In graphql-ruby 2.5.12+, the execute_query_lazy tracer method is no longer called unconditionally. It now only fires when there are lazy values to resolve. This change was introduced in graphql-ruby commit 5ba154a561 when lazy handling was merged into the dataloader. The tracer previously assumed execute_query_lazy "always fires" and relied on it to set end_time for all queries. Without this method being called, end_time remains nil, causing crashes when attaching traces to results. This fix adds a fallback in execute_multiplex to record end times for all queries after execution completes. For queries with lazy values, execute_query_lazy will still fire and overwrite these times to capture the full execution time including lazy resolution. This maintains backward compatibility with older graphql-ruby versions while fixing the crash in 2.5.12+. * Fix specs because we call record_trace_end_time an additional time. * Fix rubocop.
- Remove old appraisal-based testing for GraphQL 1.10-2.0 - Test only with Ruby 3.2, 3.3, 3.4 - Test with current GraphQL version (2.0+) - Remove appraisal-install action - Align with upstream CI configuration
- Support GraphQL versions from 2.0.19 to < 3.0 - Add targeted appraisal testing for 2.0.19 and 2.5.x - Test matrix: 3 Ruby versions × 2 GraphQL versions = 6 combinations - Ensures compatibility with both old (2.0.19) and latest (2.5.x) GraphQL 2.x versions - Much simpler than old appraisal setup (6 tests vs 15)
- Add 'bundle config set --local frozen false' before appraisal installs - Allows appraisal to generate different Gemfile.lock files for each GraphQL version - Fixes 'lockfile can't be updated because frozen mode is set' error
- ruby/setup-ruby automatically sets 'deployment true' which forces frozen mode - Need to unset deployment mode first, then disable frozen mode - Fixes: 'lockfile can't be updated because frozen mode is set' error
- bundler-cache: true automatically sets deployment mode - Set bundler-cache: false for appraisal matrix tests - Manually run bundle install without frozen/deployment mode - This allows appraisal to generate different lockfiles for each GraphQL version
GraphQL 2.3+ changed orphan_types to only accept object types. This wrapper automatically routes non-object types (unions, enums, interfaces) to extra_types in GraphQL 2.3+, while maintaining backward compatibility with GraphQL 2.0.x where orphan_types accepts all types.
GraphQL 2.2.14 is a better choice because: - Fully supports Ruby 3.x and Rails 8 - No orphan_types breaking change (works like 2.0.x) - More stable with fewer compatibility issues Testing strategy: - 2.0.19: Minimum supported version - 2.2.14: Latest stable without breaking changes
Since we're only supporting GraphQL 2.0.19 and 2.2.14 (not 2.3+), the orphan_types override is unnecessary. GraphQL 2.2 and earlier accept all types in orphan_types. The override was potentially interfering with interface type discovery.
…cop cops These are pre-existing code style issues that we haven't modified.
GraphQL 2.0-2.2 doesn't auto-discover interfaces through implementations. We need to explicitly pass both the object type and interface type to orphan_types. GraphQL 2.3+ auto-discovers interfaces, so upstream only passes the object type. This fixes the 3 interface visibility test failures.
GraphQL 2.2 introduced a change where interfaces should use extra_types instead of orphan_types. For GraphQL 2.0-2.1, we still use orphan_types for both objects and interfaces. For GraphQL 2.2+, we use extra_types for interfaces and orphan_types for objects. This matches the behavior expected by the GraphQL gem.
GraphQL 2.2-2.3 has internal differences from 2.0: 1. Makes one additional Time.now call, resulting in end_time being 1564920004 instead of 1564920003 2. Changed parser error message format from "Unexpected end of document" to "Expected NAME, actual: (none)" These are internal implementation differences that don't affect functionality.
…cted_end_time in all timing tests 1. GraphQL 2.0-2.2 requires BOTH object and interface in orphan_types. Cannot split between orphan_types and extra_types in these versions. GraphQL 2.3+ can use extra_types for both types. 2. Fixed timing tests that hardcoded expected_trace_start_time + 2 instead of using the expected_end_time variable, which properly handles the version-specific timing differences.
itaymndy
approved these changes
Oct 21, 2025
| - appraisal: 'graphql-1.12' | ||
| ruby: '3.2' | ||
| ruby: ['3.4'] | ||
| graphql: ['graphql-2.0.19', 'graphql-2.3'] |
Collaborator
Author
There was a problem hiding this comment.
I interntionally havnt as we dont use them
arutkowski00
approved these changes
Oct 22, 2025
1fb1980 to
bdc1642
Compare
Update minimum Ruby version support and migrate CI from CircleCI to GitHub Actions. BREAKING CHANGE: This release may affect projects using older Ruby versions. Please review compatibility before upgrading.
…m:mondaycom/apollo-federation-ruby into feature/romka/graphql-new-version-support
Test gem compatibility with Ruby 2.7 and 3.4 across GraphQL versions. - Add Ruby 2.7 to all CI jobs (lint, test, integration) - Make debug, rackup, mutex_m, and ostruct conditional based on Ruby version - Ensure Ruby 2.7 compatibility for development dependencies
Bundler 2.6.6 requires Ruby >= 3.1.0, so we need to use an older compatible version (2.3.x) when running tests on Ruby 2.7.
Run 'bundle update --bundler' to update the lockfile to use bundler 2.3.x when running on Ruby 2.7, avoiding the incompatibility with bundler 2.6.6.
Use the 'bundler' parameter in ruby/setup-ruby action to install bundler 2.3 for Ruby 2.7 and default for Ruby 3.4, preventing the automatic installation of incompatible bundler 2.6.6.
RuboCop warns against using RUBY_VERSION in gemspec files as it can cause issues during gem building. Use Gem.ruby_version instead. Also refactored lint job to only run on Ruby 3.4 since linting checks code style/quality, not runtime behavior, making multiple Ruby versions redundant.
arutkowski00
approved these changes
Oct 23, 2025
github-actions bot
pushed a commit
that referenced
this pull request
Oct 26, 2025
# [3.16.0](v3.15.1...v3.16.0) (2025-10-26) ### Features * Add support for Rails 8, Ruby 3, and latest GraphQL gem ([#21](#21)) ([10b1dac](10b1dac)) * improve README formatting for installation instructions ([#25](#25)) ([874e497](874e497)) * publish new version ([#24](#24)) ([b4bbd19](b4bbd19)) * revert GEM_HOST_API_KEY secret name for semantic-release ([#26](#26)) ([0fbfc10](0fbfc10))
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cherry-picked commits from upstream to support:
Changes include: