PHPackages                             vasily-kartashov/graphql-batch-processor - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. vasily-kartashov/graphql-batch-processor

ActiveLibrary[API Development](/categories/api)

vasily-kartashov/graphql-batch-processor
========================================

GraphQL batch processor

0.0.10(5y ago)1412.9kApache-2.0PHPPHP ^7 || ^8CI failing

Since Feb 6Pushed 5y ago1 watchersCompare

[ Source](https://github.com/vasily-kartashov/graphql-batch-processing)[ Packagist](https://packagist.org/packages/vasily-kartashov/graphql-batch-processor)[ RSS](/packages/vasily-kartashov-graphql-batch-processor/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (6)Versions (5)Used By (0)

GraphQL batch processor
=======================

[](#graphql-batch-processor)

[![Build Status](https://camo.githubusercontent.com/11a516933297b75c28a7c4ce728d7cfb824cbb372a406b521663f2f609fa9eac/68747470733a2f2f7472617669732d63692e6f72672f766173696c792d6b6172746173686f762f6772617068716c2d62617463682d70726f63657373696e672e737667)](https://travis-ci.org/vasily-kartashov/graphql-batch-processing)

Simple Example:
---------------

[](#simple-example)

```
// Name of the cache is `addressesByUserId`
return Batch::as('addressesByUserId')
    // Collect user IDs
    ->collectOne($user->id())
    // When all user IDs are collected, fetch addresses for all collected user IDs
    // The callback is only executed once for each set of user IDs
    // And cached internally under the name `addressesByUserId`
    ->fetchOneToMany(function (array $userIds) {
        return $this->addressRepository->findAddressesByUserIds($userIds);
    });
```

More complex example
--------------------

[](#more-complex-example)

```
return Batch::as('accountsByOrgranizationId')
    ->collectMultiple($organization->accountIds())
    ->fetchOneToOne(function (array $accountIds) {
        return $this->accountRepository->findAccountsByAccountIds($accountIds);
    });
```

Proper example
--------------

[](#proper-example)

Get all addresses for each user; post filter out hidden addresses; format each address as a string; if there's no address, default to company's address

```
return Batch::as('addressesByUserId')
    ->collectOne($user->id())
    ->filter(function (Address $address) {
        return !$address->hidden();
    })
    ->format(function (Address $address) {
        return (string) $address;
    })
    ->defaultTo([$company->defaultAddress()])
    ->fetchOneToMany(function (array $userIds) {
        return $this->addressRepository->findAddressesByUserIds($userIds);
    });
```

Tracing
-------

[](#tracing)

Batches accept PSR-3 Loggers

```
return Batch::as('usersByUserIds')
    ->setLogger($logger)
    ->collectOne(...)
    ...
```

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 69% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~356 days

Total

4

Last Release

1997d ago

PHP version history (2 changes)0.0.7PHP ^7.0

0.0.10PHP ^7 || ^8

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/875698?v=4)[vka](/maintainers/vasily-kartashov)[@vasily-kartashov](https://github.com/vasily-kartashov)

---

Top Contributors

[![huntervk](https://avatars.githubusercontent.com/u/138185050?v=4)](https://github.com/huntervk "huntervk (20 commits)")[![vasily-kartashov](https://avatars.githubusercontent.com/u/875698?v=4)](https://github.com/vasily-kartashov "vasily-kartashov (9 commits)")

---

Tags

graphqllibrarybatch

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/vasily-kartashov-graphql-batch-processor/health.svg)

```
[![Health](https://phpackages.com/badges/vasily-kartashov-graphql-batch-processor/health.svg)](https://phpackages.com/packages/vasily-kartashov-graphql-batch-processor)
```

###  Alternatives

[nuwave/lighthouse

A framework for serving GraphQL from Laravel

3.5k11.4M112](/packages/nuwave-lighthouse)[overblog/graphql-bundle

This bundle provides tools to build a GraphQL server in your Symfony App.

7968.2M34](/packages/overblog-graphql-bundle)[aimeos/ai-admin-graphql

Aimeos Admin GraphQL API extension

1.0k106.6k7](/packages/aimeos-ai-admin-graphql)[mll-lab/graphql-php-scalars

A collection of custom scalar types for usage with https://github.com/webonyx/graphql-php

1474.5M37](/packages/mll-lab-graphql-php-scalars)[ivome/graphql-relay-php

A PHP port of GraphQL Relay reference implementation

271671.3k5](/packages/ivome-graphql-relay-php)[overblog/graphql-php-generator

GraphQL types generator

29522.9k](/packages/overblog-graphql-php-generator)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
