Download the PHP package infinityloop-dev/graphpinator-persisted-queries without Composer
On this page you can find all versions of the php package infinityloop-dev/graphpinator-persisted-queries. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download infinityloop-dev/graphpinator-persisted-queries
More information about infinityloop-dev/graphpinator-persisted-queries
Files in infinityloop-dev/graphpinator-persisted-queries
Package graphpinator-persisted-queries
Short Description Module to persist validated query in cache and improve performace of repeating queries.
License MIT
Homepage https://github.com/graphpql/
Informations about the package graphpinator-persisted-queries
GraPHPinator Persisted Queries

:zap::globe_with_meridians::zap: Module to persist validated query in cache and improve performace of repeating queries.
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
Install package using composer
How to use
- Implement
\Psr\SimpleCache\CacheInterface
You need implementation of \Psr\SimpleCache\CacheInterface
where the serialized version of request is stored for later reuse.
-
Register
PersistedQueriesModule
as GraPHPinator module: - You are all set, queries are automatically cached in specified storage.
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 model | Time WITHOUT module | Time WITH module |
---|---|---|
Ryzen 5900X | ~12.44 s | ~2.16 s |
Ryzen 5600X (using VMware) | ~24.83 s | ~4.69 s |
Ryzen 5 3600 | ~14.97 s | ~2.77 s |
All versions of graphpinator-persisted-queries with dependencies
infinityloop-dev/graphpinator Version ^1.6
infinityloop-dev/utils Version ^2.3
psr/simple-cache Version ^3.0.0