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
Forever Free Full-Stack Observability | Grafana Cloud Icon
Forever Free Full-Stack Observability | Grafana Cloud

Our generous forever free tier includes the full platform, including the AI Assistant, for 3 users with 10k metrics, 50GB logs, and 50GB traces.

Built on open standards like Prometheus and OpenTelemetry, Grafana Cloud includes Kubernetes Monitoring, Application Observability, Incident Response, plus the AI-powered Grafana Assistant. Get started with our generous free tier today.
Create free account
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