PHPackages                             infinityloop-dev/graphpinator-persisted-queries - 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. infinityloop-dev/graphpinator-persisted-queries

ActiveLibrary[API Development](/categories/api)

infinityloop-dev/graphpinator-persisted-queries
===============================================

Module to persist validated query in cache and improve performace of repeating queries.

v2.0.2(4mo ago)219.5k↓34.8%23MITPHPPHP &gt;=8.1CI passing

Since Jun 29Pushed 4mo ago1 watchersCompare

[ Source](https://github.com/graphpql/graphpinator-persisted-queries)[ Packagist](https://packagist.org/packages/infinityloop-dev/graphpinator-persisted-queries)[ Docs](https://github.com/graphpql/)[ RSS](/packages/infinityloop-dev-graphpinator-persisted-queries/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (13)Versions (12)Used By (3)

GraPHPinator Persisted Queries [![PHP](https://github.com/graphpql/graphpinator-persisted-queries/workflows/PHP/badge.svg?branch=master)](https://github.com/graphpql/graphpinator-persisted-queries/actions?query=workflow%3APHP) [![codecov](https://camo.githubusercontent.com/a6cf0e958f033044347f4f251c03956c2d81e31b27ef81095c68ddd25555325f/68747470733a2f2f636f6465636f762e696f2f67682f696e66696e6974796c6f6f702d6465762f677261706870696e61746f722d7065727369737465642d717565726965732f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/infinityloop-dev/graphpinator-persisted-queries)
==================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================

[](#graphpinator-persisted-queries--)

⚡🌐⚡ Module to persist validated query in cache and improve performace of repeating queries.

Introduction
------------

[](#introduction)

This Module allows GraPHPinator to cache queries on the server to reduce server load. This module aims to reduce GraphQL overhead in parsing and validation by caching and reusing known requests.

> Please note that this module does not affect the speed of your resolver functions.

Installation
------------

[](#installation)

Install package using composer

`composer require infinityloop-dev/graphpinator-persisted-queries`

How to use
----------

[](#how-to-use)

1. Implement `\Psr\SimpleCache\CacheInterface`

You need implementation of `\Psr\SimpleCache\CacheInterface` where the serialized version of request is stored for later reuse.

2. Register `PersistedQueriesModule` as GraPHPinator module:

```
$persistModule = new \Graphpinator\PersistedQueriesModule\PersistedQueriesModule($schema, $cacheImpl);
$graphpinator = new \Graphpinator\Graphpinator(
    $schema,
    $catchExceptions,
    new \Graphpinator\Module\ModuleSet([$persistModule, /* possibly other modules */]),
    $logger,
);
```

3. You are all set, queries are automatically cached in specified storage.

Performance improvements
------------------------

[](#performance-improvements)

Simple benchmark (code in `bench` directory) shows approximatelly 80% reduction of GraphQL overhead.

Benchmark runs the same query 10k times, with 5 warmup queries before. Cache in use is a simple implementation using Redis on localhost, connection is done using php-redis extension. Opcache was disabled.

CPU modelTime WITHOUT moduleTime WITH moduleRyzen 5900X~12.44 s~2.16 sRyzen 5600X (using VMware)~24.83 s~4.69 sRyzen 5 3600~14.97 s~2.77 s

###  Health Score

51

—

FairBetter than 96% of packages

Maintenance76

Regular maintenance activity

Popularity31

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 57.6% 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 ~165 days

Recently: every ~197 days

Total

11

Last Release

130d ago

Major Versions

v1.4 → v2.02025-12-18

PHP version history (2 changes)v1.0PHP &gt;=8.0.1

v1.3PHP &gt;=8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/00654c913028f8d25a226eb2ddf368e1b999bf72fa4f77dbd1449c1df218756c?d=identicon)[peldax](/maintainers/peldax)

---

Top Contributors

[![peldax](https://avatars.githubusercontent.com/u/10790033?v=4)](https://github.com/peldax "peldax (91 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (55 commits)")[![vossik](https://avatars.githubusercontent.com/u/22434658?v=4)](https://github.com/vossik "vossik (12 commits)")

---

Tags

graphqlgraphql-phpphp

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/infinityloop-dev-graphpinator-persisted-queries/health.svg)

```
[![Health](https://phpackages.com/badges/infinityloop-dev-graphpinator-persisted-queries/health.svg)](https://phpackages.com/packages/infinityloop-dev-graphpinator-persisted-queries)
```

###  Alternatives

[algolia/algoliasearch-client-php

API powering the features of Algolia.

69433.0M114](/packages/algolia-algoliasearch-client-php)[thecodingmachine/graphqlite

Write your GraphQL queries in simple to write controllers (using webonyx/graphql-php).

5723.1M30](/packages/thecodingmachine-graphqlite)[team-reflex/discord-php

An unofficial API to interact with the voice and text service Discord.

1.1k379.4k24](/packages/team-reflex-discord-php)[wordpress/php-ai-client

A provider agnostic PHP AI client SDK to communicate with any generative AI models of various capabilities using a uniform API.

26236.6k14](/packages/wordpress-php-ai-client)[wordpress/wp-ai-client

An AI client and API for WordPress to communicate with any generative AI models of various capabilities using a uniform API.

11117.5k1](/packages/wordpress-wp-ai-client)[n1ebieski/ksef-php-client

PHP API client that allows you to interact with the API Krajowego Systemu e-Faktur

7228.4k](/packages/n1ebieski-ksef-php-client)

PHPackages © 2026

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