{"id":33996723,"url":"https://github.com/oliverearl/php-hashnode","last_synced_at":"2025-12-13T08:38:56.856Z","repository":{"id":37590171,"uuid":"324627530","full_name":"oliverearl/php-hashnode","owner":"oliverearl","description":"A framework-agnostic, ORM library for interacting and retrieving data from the Hashnode GraphQL API. (Requires PHP 7.4)","archived":false,"fork":false,"pushed_at":"2024-11-25T22:11:58.000Z","size":353,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-11-27T15:38:31.485Z","etag":null,"topics":["graphql","hashnode","hashnode-api","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/oliverearl.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","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},"funding":{"github":null,"patreon":null,"open_collective":null,"ko_fi":"oliverearl","tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":["https://www.buymeacoffee.com/oliverearl"]}},"created_at":"2020-12-26T20:10:18.000Z","updated_at":"2024-11-25T22:11:43.000Z","dependencies_parsed_at":"2024-11-26T00:17:42.387Z","dependency_job_id":null,"html_url":"https://github.com/oliverearl/php-hashnode","commit_stats":{"total_commits":107,"total_committers":2,"mean_commits":53.5,"dds":"0.028037383177570097","last_synced_commit":"bcbf66300fa8215e06ef2697e3b3b173b8527acd"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/oliverearl/php-hashnode","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oliverearl%2Fphp-hashnode","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oliverearl%2Fphp-hashnode/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oliverearl%2Fphp-hashnode/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oliverearl%2Fphp-hashnode/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oliverearl","download_url":"https://codeload.github.com/oliverearl/php-hashnode/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oliverearl%2Fphp-hashnode/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27702670,"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-12-13T02:00:09.769Z","response_time":147,"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","hashnode","hashnode-api","php"],"created_at":"2025-12-13T08:38:56.234Z","updated_at":"2025-12-13T08:38:56.850Z","avatar_url":"https://github.com/oliverearl.png","language":"PHP","funding_links":["https://ko-fi.com/oliverearl","https://www.buymeacoffee.com/oliverearl"],"categories":[],"sub_categories":[],"readme":"[![Contributors][contributors-shield]][contributors-url]\n[![Forks][forks-shield]][forks-url]\n[![Stargazers][stars-shield]][stars-url]\n[![Issues][issues-shield]][issues-url]\n[![MIT License][license-shield]][license-url]\n[![LinkedIn][linkedin-shield]][linkedin-url]\n\n\u003c!-- PROJECT LOGO --\u003e\n\u003cbr /\u003e\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/oliverearl/php-hashnode\"\u003e\n    \u003cimg src=\".github/PHP-Hashnode.png\" alt=\"PHP Hashnode\" height=\"500\" width=\"500\"\u003e\n  \u003c/a\u003e\n\n\u003ch3 align=\"center\"\u003eUnofficial Hashnode API Wrapper for PHP\u003c/h3\u003e\n\n  \u003cp align=\"center\"\u003e\n    A lightweight, object-oriented library for interacting with Hashnode's GraphQL API.\n    \u003cbr /\u003e\n    \u003ca href=\"https://github.com/oliverearl/php-hashnode/tree/master/docs\"\u003e\u003cstrong\u003eExplore the docs »\u003c/strong\u003e\u003c/a\u003e\n    \u003cbr /\u003e\n    \u003cbr /\u003e\n    \u003ca href=\"https://github.com/oliverearl/php-hashnode/tree/master/examples\"\u003eView Examples\u003c/a\u003e\n    ·\n    \u003ca href=\"https://github.com/oliverearl/php-hashnode/issues\"\u003eReport Bug\u003c/a\u003e\n    ·\n    \u003ca href=\"https://github.com/oliverearl/php-hashnode/issues\"\u003eRequest Feature\u003c/a\u003e\n  \u003c/p\u003e\n\n\u003c!-- TABLE OF CONTENTS --\u003e\n\u003cdetails open=\"open\"\u003e\n  \u003csummary\u003e\u003ch2 style=\"display: inline-block\"\u003eTable of Contents\u003c/h2\u003e\u003c/summary\u003e\n  \u003col\u003e\n    \u003cli\u003e\n      \u003ca href=\"#about-the-project\"\u003eAbout The Project\u003c/a\u003e\n      \u003cul\u003e\n        \u003cli\u003e\u003ca href=\"#built-with\"\u003eBuilt With\u003c/a\u003e\u003c/li\u003e\n      \u003c/ul\u003e\n    \u003c/li\u003e\n    \u003cli\u003e\n      \u003ca href=\"#getting-started\"\u003eGetting Started\u003c/a\u003e\n      \u003cul\u003e\n        \u003cli\u003e\u003ca href=\"#prerequisites\"\u003ePrerequisites\u003c/a\u003e\u003c/li\u003e\n        \u003cli\u003e\u003ca href=\"#installation\"\u003eInstallation\u003c/a\u003e\u003c/li\u003e\n      \u003c/ul\u003e\n    \u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#usage\"\u003eUsage\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#roadmap\"\u003eRoadmap\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#contributing\"\u003eContributing\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#license\"\u003eLicense\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#contact\"\u003eContact\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#acknowledgements\"\u003eAcknowledgements\u003c/a\u003e\u003c/li\u003e\n  \u003c/ol\u003e\n\u003c/details\u003e\n\n## About The Project\n\n### Built With\n\n* [PHP GraphQL Client](https://github.com/mghoneimy/php-graphql-client)\n\n* [PHP GraphQL OQM](https://github.com/mghoneimy/php-graphql-oqm)\n\n* [PHPUnit](https://phpunit.de/) and [Faker](https://www.github.com/fzaninotto/faker) for testing.\n\n## Getting Started\n\nTo get a local copy up and running follow these simple steps.\n\n### Prerequisites\n\n* [PHP 7.4 or greater](https://php.net)\n\n* [Composer](https://getcomposer.org)\n\n### Installation\n\n1. Clone the repo\n\n   ```sh\n   git clone https://github.com/oliverearl/php-hashnode.git\n   ```\n\n2. Install Composer packages\n\n   ```sh\n   composer install\n   ```\n\nThis library will be made available for install via Composer once it has reached a more complete state.\n\n## Usage\n\nAfter installation, the library is ready to use out-of-the-box. A client instance and GraphQL root query object can be made like thus:\n\n```php\n$client = new Hashnode();\n\n$query = new RootQuery();\n```\n\nIf you wish to specify an override for the default Hashnode endpoint, and/or specify your Hashnode API token (if you need one, you can get one [here](https://hashnode.com/settings/developer)) you can add them as constructor parameters. **You don't need an API token for most operations at present.**\n\n```php\n$client = new Hashnode('https://some-alternative-endpoint.hashnode.com', [\n  'Authorization' =\u003e 'my-api-key-goes-here'\n]);\n```\n\nRemember when interacting with GraphQL APIs, you have to specifically indicate what information you want to request. If you wanted to request a stories feed with a title, date, and the author's username, you could do something like this:\n\n*(Also, this is assuming you utilise 'use statements' and don't have to resolve namespaces fully.)*\n\n```php\n$query-\u003eselectStoriesFeed((new RootStoriesFeedArgument())-\u003esetType('NEW'))\n    -\u003eselectTitle()\n    -\u003eselectDateAdded()\n    -\u003eselectAuthor((new AuthorArgument()))\n    -\u003eselectUsername();\n\n$results = $client-\u003erunQuery($query-\u003egetQuery())-\u003egetData();\n```\n\n_For more examples, please refer to the [Documentation](https://github.com/oliverearl/php-hashnode/tree/master/docs) or check available [examples](https://github.com/oliverearl/php-hashnode/tree/master/examples)._\n\n## Roadmap\n\nThe following is on the roadmap for upcoming releases:\n\n* API behaviours that require an API key (creating, updating, deleting)\n\n* Changes to make the library easier to use and potentially less dependent on the underlying GraphQL libraries\n\n* Cleaner, less lasagna-like code\n\n* Integration PHPUnit tests\n\nAlso, see the [open issues](https://github.com/oliverearl/php-hashnode/issues) for a list of user-proposed features (and known issues).\n\n## Contributing\n\nContributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are **greatly appreciated**.\n\n### Particularly welcome contributions\n\n* Bugfixes and beneficiary changes to existing functionality.\n\n* New functionality that fulfills unimplemented areas of the API.\n\n* Enhancements to existing or production of additional PHPUnit tests.\n\n* Documentation, both in the source code and in the `docs` directory.\n\n* Examples of the library in use within the `examples` directory.\n\n### Instructions\n\n1. Fork the Project\n2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)\n3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)\n4. Push to the Branch (`git push origin feature/AmazingFeature`)\n5. Open a Pull Request\n\n## Testing\n\nThe suite of PHPUnit tests can be run with `composer run test` at your terminal, assuming a full installation of Composer.\n\nAlternatively, you can retrieve easy-to-read *testdox* by running `composer run testdox`.\n\n## License\n\nDistributed under the MIT License. See `LICENSE` for more information.\n\n## Contact\n\nOliver Earl - oliver@oliverearl.co.uk\n\nProject Link: [https://github.com/oliverearl/php-hashnode](https://github.com/oliverearl/php-hashnode)\n\n## Acknowledgements\n\n* [Mostafa Ghoneimy et al for the underpinning GraphQL technologies.](https://github.com/mghoneimy)\n\n* [The amazing people over at Hashnode.](https://www.hashnode.com)\n\n* [Hashnode's GraphQL API](https://api.hashnode.com)\n\n* [Othneil Drew for the README template](https://github.com/othneildrew/Best-README-Template)\n\n[contributors-shield]: https://img.shields.io/github/contributors/oliverearl/php-hashnode.svg?style=for-the-badge\n[contributors-url]: https://github.com/oliverearl/php-hashnode/graphs/contributors\n[forks-shield]: https://img.shields.io/github/forks/oliverearl/php-hashnode.svg?style=for-the-badge\n[forks-url]: https://github.com/oliverearl/php-hashnode/network/members\n[stars-shield]: https://img.shields.io/github/stars/oliverearl/php-hashnode.svg?style=for-the-badge\n[stars-url]: https://github.com/oliverearl/php-hashnode/stargazers\n[issues-shield]: https://img.shields.io/github/issues/oliverearl/php-hashnode.svg?style=for-the-badge\n[issues-url]: https://github.com/oliverearl/php-hashnode/issues\n[license-shield]: https://img.shields.io/github/license/oliverearl/php-hashnode.svg?style=for-the-badge\n[license-url]: https://github.com/oliverearl/php-hashnode/blob/master/LICENSE\n[linkedin-shield]: https://img.shields.io/badge/-LinkedIn-black.svg?style=for-the-badge\u0026logo=linkedin\u0026colorB=555\n[linkedin-url]: https://linkedin.com/in/oliverearl\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foliverearl%2Fphp-hashnode","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foliverearl%2Fphp-hashnode","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foliverearl%2Fphp-hashnode/lists"}