{"id":20111926,"url":"https://github.com/graphpql/graphpinator-persisted-queries","last_synced_at":"2026-01-08T14:14:03.637Z","repository":{"id":36977156,"uuid":"371974283","full_name":"graphpql/graphpinator-persisted-queries","owner":"graphpql","description":":zap::globe_with_meridians::zap: Module to persist validated query in cache and improve performace of repeating queries.","archived":false,"fork":false,"pushed_at":"2024-12-11T15:16:39.000Z","size":264,"stargazers_count":2,"open_issues_count":3,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-04T11:58:58.020Z","etag":null,"topics":["graphql","graphql-php","php"],"latest_commit_sha":null,"homepage":"https://github.com/graphpql","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/graphpql.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-05-29T13:00:57.000Z","updated_at":"2024-12-11T15:16:43.000Z","dependencies_parsed_at":"2024-04-25T14:29:59.931Z","dependency_job_id":"b04c86a6-1e10-4457-88ac-7fa928c26a7d","html_url":"https://github.com/graphpql/graphpinator-persisted-queries","commit_stats":null,"previous_names":["graphpql/graphpinator-persisted-queries","infinityloop-dev/graphpinator-persisted-queries"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/graphpql/graphpinator-persisted-queries","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphpql%2Fgraphpinator-persisted-queries","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphpql%2Fgraphpinator-persisted-queries/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphpql%2Fgraphpinator-persisted-queries/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphpql%2Fgraphpinator-persisted-queries/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/graphpql","download_url":"https://codeload.github.com/graphpql/graphpinator-persisted-queries/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphpql%2Fgraphpinator-persisted-queries/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278532360,"owners_count":26002345,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-05T02:00:06.059Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["graphql","graphql-php","php"],"created_at":"2024-11-13T18:18:13.222Z","updated_at":"2026-01-05T12:21:30.414Z","avatar_url":"https://github.com/graphpql.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 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://codecov.io/gh/infinityloop-dev/graphpinator-persisted-queries/branch/master/graph/badge.svg)](https://codecov.io/gh/infinityloop-dev/graphpinator-persisted-queries)\n\n:zap::globe_with_meridians::zap: Module to persist validated query in cache and improve performace of repeating queries.\n\n## Introduction\n\nThis 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.\n\n\u003e Please note that this module does not affect the speed of your resolver functions.\n\n## Installation\n\nInstall package using composer\n\n```composer require infinityloop-dev/graphpinator-persisted-queries```\n\n## How to use\n\n1. Implement `\\Psr\\SimpleCache\\CacheInterface`\n\nYou need implementation of `\\Psr\\SimpleCache\\CacheInterface` where the serialized version of request is stored for later reuse.\n\n2. Register `PersistedQueriesModule` as GraPHPinator module:\n\n```php\n$persistModule = new \\Graphpinator\\PersistedQueriesModule\\PersistedQueriesModule($schema, $cacheImpl);\n$graphpinator = new \\Graphpinator\\Graphpinator(\n    $schema,\n    $catchExceptions,\n    new \\Graphpinator\\Module\\ModuleSet([$persistModule, /* possibly other modules */]),\n    $logger,\n);\n```\n\n3. You are all set, queries are automatically cached in specified storage.\n\n## Performance improvements\n\nSimple benchmark (code in `bench` directory) shows approximatelly 80% reduction of GraphQL overhead.\n\nBenchmark 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.\n\n| CPU model | Time WITHOUT module | Time WITH module |\n| --------- | ------------------- | ---------------- |\n| Ryzen 5900X | ~12.44 s | ~2.16 s |\n| Ryzen 5600X (using VMware) | ~24.83 s | ~4.69 s |\n| Ryzen 5 3600 | ~14.97 s | ~2.77 s |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgraphpql%2Fgraphpinator-persisted-queries","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgraphpql%2Fgraphpinator-persisted-queries","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgraphpql%2Fgraphpinator-persisted-queries/lists"}