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
Custom VMs From 1 to 96 vCPUs With 99.95% Uptime Icon
Custom VMs From 1 to 96 vCPUs With 99.95% Uptime

General-purpose, compute-optimized, or GPU/TPU-accelerated. Built to your exact specs.

Live migration and automatic failover keep workloads online through maintenance. One free e2-micro VM every month.
Try 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