A query batching executor for the graphql gem. Provides an executor for the graphql gem which allows queries to be batched. Define a custom loader, which is initialized with arguments that are used for grouping and a perform method for performing the batch load. Use GraphQL::Batch as a plugin in your schema after specifying the mutation so that GraphQL::Batch can extend the mutation fields to clear the cache after they are resolved. The loader class can be used from the resolver for a graphql field by calling .for with the grouping arguments to get a loader instance, then call .load on that instance with the key to load. Although this library doesn't have a dependency on active record, the examples directory has record and association loaders for active record which handles edge cases like type-casting ids. GraphQL::Batch::Loader#load returns a Promise using the promise.rb gem to provide a promise-based API, so you can transform the query results using .then.

Features

  • Schema Configuration
  • The loader also supports batch loading an array of records
  • Unit Testing
  • Provides an executor for the graphql gem
  • Allows queries to be batched
  • Your loaders can be tested outside of a GraphQL query

Project Samples

Project Activity

See All Activity >

License

MIT License

Follow GraphQL Batch

GraphQL Batch Web Site

Other Useful Business Software
MongoDB Atlas runs apps anywhere Icon
MongoDB Atlas runs apps anywhere

Deploy in 115+ regions with the modern database for every enterprise.

MongoDB Atlas gives you the freedom to build and run modern applications anywhere—across AWS, Azure, and Google Cloud. With global availability in over 115 regions, Atlas lets you deploy close to your users, meet compliance needs, and scale with confidence across any geography.
Start Free
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of GraphQL Batch!

Additional Project Details

Programming Language

Ruby

Related Categories

Ruby Software Development Software

Registered

2023-03-02