GraphQL-Ruby Newsletter logo

GraphQL-Ruby Newsletter

Subscribe
Archives
March 7, 2019

What's new in GraphQL-Ruby 1.9...

Hi!

GraphQL 1.9 is ready for take-off! I've been working on these features since last summer and I'm excited to release them. Here's some of what you'll find in the gem:
  • Class-based subscription fields with GraphQL::Schema::Subscription, supporting a much richer subscription flow. There are some crucial features here, like conditional updates and server-side unsubscribes.
  • GraphQL::Execution::Lookahead for making your field resolvers context-aware. This is a reliable, simple way to tweak database access based on downstream selections.
  • A new runtime for executing queries which reduces time and memory by half. It works with class-based GraphQL only, but in my experience, it's been worth the effort to migrate. You can read more about the rationale and work on my blog.
  • AST changes: parsed GraphQL queries are now frozen, and the gem includes an API for building modified documents. If you work on client tooling, this guarantees that valid queries stay valid 😂. To modify a parsed AST, use a visitor.
  • Validation errors now include `"extensions" : { ... }` which provide some context about the error.
  • Custom directives, allowing you to further customize the new runtime.
  • Lots more improvements and bug fixes, which you find in the CHANGELOG.
So, please give these new features a try, and if you run into any trouble, don't hesitate to open an issue! For my part, I'll continue to improve these new features and start thinking about improvements for 1.10.0 😎.

GraphQL-Pro (now 1.10.x) has also seen a lot of improvement in the last few months:
  • @defer, a custom directive for sending GraphQL responses bit-by-bit. You can read about the advantages of @defer on Apollo's blog or check out the example app to see how it works with Rails. (Since this is a custom directive, it's only supported by the new runtime mentioned above.)
  • A new subscription implementation, using Ably.io.
  • Continued improvements to the CanCan integration and Pundit integration.
Finally, I thought I'd share a few other projects that were on my radar recently:
  • envek/graphql-anycable: GraphQL subscriptions for AnyCable, which is a fast, low-overhead reimplementation of the ActionCable protocol. Seems like a promising option for large-scale, self-hosted subscriptions.
  • yuki24/artemis: A GraphQL client for Ruby & Rails with productive conventions and testing support.
  • How To GraphQL: The Ruby component of this tutorial just got a big update. Thanks @rstankov for maintaining this!
I think that's all for today, have fun with the new goodies in v1.9+!

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.