{"id":14975993,"url":"https://github.com/bendeckdavid/graphql-client","last_synced_at":"2026-01-14T01:30:11.895Z","repository":{"id":37050679,"uuid":"441044594","full_name":"bendeckdavid/graphql-client","owner":"bendeckdavid","description":"Minimal GraphQL client for Laravel.","archived":true,"fork":false,"pushed_at":"2024-09-10T11:16:14.000Z","size":110,"stargazers_count":46,"open_issues_count":6,"forks_count":17,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-10T03:54:31.621Z","etag":null,"topics":["client","graphql","graphql-client","laravel","php"],"latest_commit_sha":null,"homepage":"","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/bendeckdavid.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","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}},"created_at":"2021-12-23T02:55:13.000Z","updated_at":"2025-03-27T01:11:02.000Z","dependencies_parsed_at":"2024-09-10T12:41:33.949Z","dependency_job_id":"6950ffc7-1bfa-48fc-9761-a2ca19a4746e","html_url":"https://github.com/bendeckdavid/graphql-client","commit_stats":{"total_commits":39,"total_committers":6,"mean_commits":6.5,"dds":0.5128205128205128,"last_synced_commit":"c42c3be4db4aa9cea26a34850a2fe9c4fa6f111e"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/bendeckdavid/graphql-client","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bendeckdavid%2Fgraphql-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bendeckdavid%2Fgraphql-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bendeckdavid%2Fgraphql-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bendeckdavid%2Fgraphql-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bendeckdavid","download_url":"https://codeload.github.com/bendeckdavid/graphql-client/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bendeckdavid%2Fgraphql-client/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28408201,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T00:40:43.272Z","status":"ssl_error","status_checked_at":"2026-01-14T00:40:42.636Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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-client","laravel","php"],"created_at":"2024-09-24T13:53:06.266Z","updated_at":"2026-01-14T01:30:11.859Z","avatar_url":"https://github.com/bendeckdavid.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Minimal GraphQL Laravel Client\n\nMinimal GraphQL client for Laravel.\n\n\n## Requirements\n\n- Composer 2+\n\n\n## Installation\n\nInstall Package (Composer 2+)\n```bash\ncomposer require bendeckdavid/graphql-client\n```\n\n\n## Usage\n\nEnviroment variable \n```php\nGRAPHQL_ENDPOINT=\"https://api.spacex.land/graphql/\"\n```\n\n\n## Authentication\n\nWe provide a minimal authentication integration by appending the `Authorization` header to the request client. You can pass the credentials using an `env` variable.\n```php\nGRAPHQL_CREDENTIALS=\"YOUR_CREDENTIALS\"\n```\n\nYou can also pass auth credentials at runtime using `withToken($credentials)` method.\n\n\n'Authorization' header and 'Bearer' Schema are used by default. You can override the default behaviour by defining following variables in your `.env` file.\n```php\nGRAPHQL_AUTHENTICATION_HEADER=\"Authorization\"\n\n// Allowed: basic, bearer, custom\nGRAPHQL_AUTHENTICATION=\"bearer\"\n```\n\n\n## Usage/Examples\n\nImport GraphQL Client Facades\n```php\nuse BendeckDavid\\GraphqlClient\\Facades\\GraphQL;\n```\n\n#### Basic use\n\n```php\nreturn GraphQL::query('\n    capsules {\n        id\n        original_launch\n        status\n        missions {\n            name\n            flight\n        }\n    }\n')-\u003eget();\n//-\u003eget('json'); //get response as json object\n```\n\n#### Mutator Request\n\n```php\nreturn GraphQL::mutator('\n    insert_user(name: \"David\") {\n        id\n        name\n        date_added\n    }\n')-\u003eget();\n//-\u003eget('json');\n```\n\nYou can access \"query\" or \"mutator\" as a shortcut if you are not passing variables, if is not the case you must use the \"raw\" attribute:\n\n```php\nreturn GraphQL::raw('\n    mutation($name: String) {\n        insert_user(name: $name) {\n            id\n            name\n            date_added\n        }\n    }\n')\n-\u003ewith([\"name\" =\u003e \"David\"])\n-\u003eget();\n//-\u003eget('json');\n```\n\nThe `variables` or `payload` to the GraphQL request can also be passed using magic methods like:\n\n```php\nreturn GraphQL::raw('\n    mutation($name: String) {\n        insert_user(name: $name) {\n            id\n            name\n            date_added\n        }\n    }\n')\n-\u003ewithName(\"David\")\n-\u003eget();\n//-\u003eget('json');\n```\n\n#### Raw Response\n\nYou can get the raw response from the GraphQL request by using `getRaw()` method instead of `get()` in the request.\n\n```php\nreturn GraphQL::raw('\n    mutation($name: String) {\n        insert_user(name: $name) {\n            id\n            name\n            date_added\n        }\n    }\n')\n-\u003ewith([\"name\" =\u003e \"David\"])\n-\u003egetRaw();\n//-\u003egetRaw('json');\n```\n\nIf you want to address the request to another endpoint, you can do :\n\n```php\nreturn GraphQL::endpoint(\"https://api.spacex.land/graphql/\")\n-\u003equery('\n    capsules {\n        id\n        original_launch\n        status\n        missions {\n            name\n            flight\n        }\n    }\n')-\u003eget();\n//-\u003eget('json');\n```\n\n## Headers\n\nYou can include a header to the request by using the attribute \"header\" or add multiple headers by \"withHeaders\":\n```php\nreturn GraphQL::query($query)\n-\u003eheader('name', 'value')\n-\u003ewithHeaders([\n    'name' =\u003e 'value',\n    'name' =\u003e 'value'\n])-\u003eget();\n```\n\n## Context\n\nAdd additional context to the request\n```php\nreturn GraphQL::query($query)\n-\u003econtext([\n    'ssl' =\u003e [\n         \"verify_peer\" =\u003e false,\n         \"verify_peer_name\" =\u003e false,\n    ]\n  ])-\u003eget();\n```\n\n\n## Author\n\n- David Gutierrez [@bendeckdavid](https://www.github.com/bendeckdavid)\n\n\n## Top Contributors ⭐\n\n- Ehsan Quddusi [@ehsanquddusi](https://github.com/ehsanquddusi)\n\n## Contributors\n\n- Ryan Mayberry [@kerkness](https://github.com/kerkness)\n- Jamie Duong [@chiendv](https://github.com/chiendv)\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbendeckdavid%2Fgraphql-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbendeckdavid%2Fgraphql-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbendeckdavid%2Fgraphql-client/lists"}