{"id":16485992,"url":"https://github.com/simpod/php-graphql-request-factory","last_synced_at":"2025-09-18T17:31:25.247Z","repository":{"id":41884647,"uuid":"161248165","full_name":"simPod/PHP-GraphQL-Request-Factory","owner":"simPod","description":"GraphQL PSR-7 Request Factory","archived":false,"fork":false,"pushed_at":"2025-08-11T13:54:09.000Z","size":83,"stargazers_count":0,"open_issues_count":4,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-09-15T18:45:43.222Z","etag":null,"topics":["client","graphql","graphql-request-factory","hacktoberfest","php","psr-17","psr-18","psr-7"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/simPod.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":["simPod"]}},"created_at":"2018-12-10T23:06:56.000Z","updated_at":"2025-05-08T20:41:09.000Z","dependencies_parsed_at":"2024-03-23T21:26:27.497Z","dependency_job_id":"3cbef636-c802-4984-9476-0f71ee12472c","html_url":"https://github.com/simPod/PHP-GraphQL-Request-Factory","commit_stats":{"total_commits":19,"total_committers":1,"mean_commits":19.0,"dds":0.0,"last_synced_commit":"07a55ba78e2b55e04b8bff2fe27a8c30261c3489"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/simPod/PHP-GraphQL-Request-Factory","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simPod%2FPHP-GraphQL-Request-Factory","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simPod%2FPHP-GraphQL-Request-Factory/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simPod%2FPHP-GraphQL-Request-Factory/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simPod%2FPHP-GraphQL-Request-Factory/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/simPod","download_url":"https://codeload.github.com/simPod/PHP-GraphQL-Request-Factory/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simPod%2FPHP-GraphQL-Request-Factory/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275804654,"owners_count":25531723,"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-09-18T02:00:09.552Z","response_time":77,"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":["client","graphql","graphql-request-factory","hacktoberfest","php","psr-17","psr-18","psr-7"],"created_at":"2024-10-11T13:28:02.073Z","updated_at":"2025-09-18T17:31:25.005Z","avatar_url":"https://github.com/simPod.png","language":"PHP","funding_links":["https://github.com/sponsors/simPod"],"categories":[],"sub_categories":[],"readme":"# PHP GraphQL Request Factory\n\n[![GitHub Actions][GA Image]][GA Link]\n[![Code Coverage][Coverage Image]][CodeCov Link]\n[![Downloads][Downloads Image]][Packagist Link]\n[![Packagist][Packagist Image]][Packagist Link]\n[![Infection MSI][Infection Image]][Infection Link]\n\nThis factory creates PSR-7 GraphQL Request through PSR-17 message factories\nthat you can be passed to PSR-18 client. \n\n## Installation\n\nAdd as [Composer](https://getcomposer.org/) dependency:\n\n```sh\ncomposer require simpod/graphql-request-factory\n```\n\n## Usage\n\n```php\n\u003c?php\n\ndeclare(strict_types=1);\n\nnamespace YourNs;\n\nuse SimPod\\GraphQLRequestFactory\\GraphQLRequestFactory;\n\n$requestFactory = new GraphQLRequestFactory(new RequestFactoryInterfaceImpl(), new StreamFactoryInterfaceImpl());\n\n$request = $requestFactory-\u003ecreateRequest(\n    'https://localhost/graphql',\n    \u003c\u003c\u003c'GRAPHQL'\nquery GetHuman($id: ID!) {\n  human(id: $id) {\n    name\n    appearsIn\n    starships {\n      name\n    }\n  }\n}\nGRAPHQL,\n    ['id' =\u003e 1]\n);\n```\n\nYou can pass `$query` either as a `string` or PSR-7 `StreamInterface`.\n\n### Mkay, but what should I do with the request then?\n\nYou can pass it to any HTTP client supporting PSR-7. It's up to you what client you decide to use.\n\n#### Guzzle\n\nhttp://docs.guzzlephp.org/en/stable/quickstart.html#sending-requests\n\n```php\n$response = $client-\u003esend($request);\n```\n\n#### PSR-18 Client (eg. HTTPPlug)\n\nhttps://www.php-fig.org/psr/psr-18/#clientinterface\n\n```php\n$response = $client-\u003esendRequest($request);\n```\n\n[GA Image]: https://github.com/simPod/PHP-GraphQL-Request-Factory/workflows/Continuous%20Integration/badge.svg\n[GA Link]: https://github.com/simPod/PHP-GraphQL-Request-Factory/actions?query=workflow%3A%22Continuous+Integration%22+branch%3Amaster\n[Coverage Image]: https://codecov.io/gh/simPod/PHP-GraphQL-Request-Factory/branch/master/graph/badge.svg\n[CodeCov Link]: https://codecov.io/gh/simPod/PHP-GraphQL-Request-Factory/branch/master\n[Downloads Image]: https://poser.pugx.org/simpod/graphql-request-factory/d/total.svg\n[Packagist Image]: https://poser.pugx.org/simpod/graphql-request-factory/v/stable.svg\n[Packagist Link]: https://packagist.org/packages/simpod/graphql-request-factory\n[Infection Image]: https://img.shields.io/endpoint?style=flat\u0026url=https%3A%2F%2Fbadge-api.stryker-mutator.io%2Fgithub.com%2FsimPod%2FPHP-GraphQL-Request-Factory%2Fmaster\n[Infection Link]: https://infection.github.io\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimpod%2Fphp-graphql-request-factory","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimpod%2Fphp-graphql-request-factory","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimpod%2Fphp-graphql-request-factory/lists"}