GraphQL-Ruby Newsletter logo

GraphQL-Ruby Newsletter

Subscribe
Archives
December 4, 2024

GraphQL-Ruby 2.4 Update

Hey Everyone,

I recently shipped GraphQL-Ruby v2.4 to RubyGems and I’m writing to let you know what’s new since my last email:

  • Development: GraphQL-Ruby now supports lazy-loading type definitions as needed in development. This can speed up your Rails app’s boot time, especially if you have a big schema. Read about opting in to this setup here: Lazy-loading types. Additionally, v2.4.5 includes incrementally loading the library itself (using Ruby’s autoload). If you're using something other than Rails, you'll want to make sure you're eager-loading it in production.
  • Security: max_query_string_tokens and validate_timeout are new options for managing use of your GraphQL API.
  • Instrumentation: GraphQL::Current provides some methods for tagging your SQL queries with ActiveRecord::QueryLogs
  • Parsing: Since GraphQL-Ruby v2.3.0, the parser no longer accepts newlines in the middle of single-quoted strings. Use GraphQL::Language.escape_single_quoted_newline to assess and handle invalid query strings.
  • Performance: GraphQL::Dataloader now accepts a fiber_limit: option for limiting memory usage for very large operations. This option is also supported by the AsyncDataloader.

Beyond these, many more improvements and fixes are listed in the CHANGELOG.

GraphQL::Pro and GraphQL::Enterprise got some updates, too:

  • The @defer directive’s delimiter format was improved for better response handling.
  • Rails generators are available for the OperationStore, Pundit integration and CanCan integration.
  • The ObjectCache now supports Dalli, ConnectionPool, and Redis Cluster backends.
  • Pusher subscriptions and Ably subscriptions now report more data to the dashboard and handle very large numbers of subscribers (10,000+) better. They also use a single channel to distribute broadcasted updates.
  • The JavaScript client has improved subscriptions integrations with urql, Relay, ActionCable and Ably. The sync tool now supports Apollo’s generate-persisted-query-manifest.

The full list of changes are found in the GraphQL::Pro changelog, GraphQL::Enterprise changelog, and graphql-ruby-client changelog.

I hope you found this update useful! Best,

Robert

Don't miss what's next. Subscribe to GraphQL-Ruby Newsletter:
Docs GitHub
This email brought to you by Buttondown, the easiest way to start and grow your newsletter.