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
Passwordless Authentication and Passwordless Security Icon
Passwordless Authentication and Passwordless Security

Identity is everything. Protect it with Duo.

It’s no secret — passwords can be a real headache, both for the people who use them and the people who manage them. Over time, we’ve created hundreds of passwords, it’s easy to lose track of them and they’re easily compromised. Fortunately, passwordless authentication is becoming a feasible reality for many businesses. Duo can help you get there.
Get a Free Trial
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