PHPackages                             oliverearl/php-hashnode - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. oliverearl/php-hashnode

AbandonedArchivedLibrary[API Development](/categories/api)

oliverearl/php-hashnode
=======================

A lightweight, object-oriented library for interacting with Hashnode's GraphQL API.

v1.0.4(1y ago)58MITPHPPHP ^7.4 || ^8.0

Since Apr 15Pushed 1y agoCompare

[ Source](https://github.com/oliverearl/php-hashnode)[ Packagist](https://packagist.org/packages/oliverearl/php-hashnode)[ Fund](https://www.buymeacoffee.com/oliverearl)[ Fund](https://ko-fi.com/oliverearl)[ RSS](/packages/oliverearl-php-hashnode/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (5)Dependencies (5)Versions (5)Used By (0)

[![Contributors](https://camo.githubusercontent.com/2fc176c3d5343abe860052d5c306bb82423ca39b61739bdafd8652fd900bc019/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f636f6e7472696275746f72732f6f6c697665726561726c2f7068702d686173686e6f64652e7376673f7374796c653d666f722d7468652d6261646765)](https://github.com/oliverearl/php-hashnode/graphs/contributors)[![Forks](https://camo.githubusercontent.com/086878786cf9a3b1950bf3bb8054979dc205098d89e327fe9f05f13c57969ccb/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f666f726b732f6f6c697665726561726c2f7068702d686173686e6f64652e7376673f7374796c653d666f722d7468652d6261646765)](https://github.com/oliverearl/php-hashnode/network/members)[![Stargazers](https://camo.githubusercontent.com/563f2c3b7b9a8492175497b6094de58dc286e4103195a94c8223b415690f4ccb/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f6f6c697665726561726c2f7068702d686173686e6f64652e7376673f7374796c653d666f722d7468652d6261646765)](https://github.com/oliverearl/php-hashnode/stargazers)[![Issues](https://camo.githubusercontent.com/555638ce03ddd0ca86449f2c57f85c2c97b80db976262e3a1777549f29a2bd84/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f6f6c697665726561726c2f7068702d686173686e6f64652e7376673f7374796c653d666f722d7468652d6261646765)](https://github.com/oliverearl/php-hashnode/issues)[![MIT License](https://camo.githubusercontent.com/ff5ebc1549a010faec3aee250ddc159082d54867f3dfbfba7a2a985bdb7cef52/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6f6c697665726561726c2f7068702d686173686e6f64652e7376673f7374796c653d666f722d7468652d6261646765)](https://github.com/oliverearl/php-hashnode/blob/master/LICENSE)[![LinkedIn](https://camo.githubusercontent.com/d52963778220cbec61d6ed72270f9735024ffceeb551e5c3933d4e03b4694cf1/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f2d4c696e6b6564496e2d626c61636b2e7376673f7374796c653d666f722d7468652d6261646765266c6f676f3d6c696e6b6564696e26636f6c6f72423d353535)](https://linkedin.com/in/oliverearl)

 [ ![PHP Hashnode](.github/PHP-Hashnode.png) ](https://github.com/oliverearl/php-hashnode)

### Unofficial Hashnode API Wrapper for PHP

[](#unofficial-hashnode-api-wrapper-for-php)

 A lightweight, object-oriented library for interacting with Hashnode's GraphQL API.
 [**Explore the docs »**](https://github.com/oliverearl/php-hashnode/tree/master/docs)

 [View Examples](https://github.com/oliverearl/php-hashnode/tree/master/examples) · [Report Bug](https://github.com/oliverearl/php-hashnode/issues) · [Request Feature](https://github.com/oliverearl/php-hashnode/issues)

 Table of Contents
-----------------

[](#table-of-contents)

1. [About The Project](#about-the-project)
    - [Built With](#built-with)
2. [Getting Started](#getting-started)
    - [Prerequisites](#prerequisites)
    - [Installation](#installation)
3. [Usage](#usage)
4. [Roadmap](#roadmap)
5. [Contributing](#contributing)
6. [License](#license)
7. [Contact](#contact)
8. [Acknowledgements](#acknowledgements)

About The Project
-----------------

[](#about-the-project)

### Built With

[](#built-with)

- [PHP GraphQL Client](https://github.com/mghoneimy/php-graphql-client)
- [PHP GraphQL OQM](https://github.com/mghoneimy/php-graphql-oqm)
- [PHPUnit](https://phpunit.de/) and [Faker](https://www.github.com/fzaninotto/faker) for testing.

Getting Started
---------------

[](#getting-started)

To get a local copy up and running follow these simple steps.

### Prerequisites

[](#prerequisites)

- [PHP 7.4 or greater](https://php.net)
- [Composer](https://getcomposer.org)

### Installation

[](#installation)

1. Clone the repo

    ```
    git clone https://github.com/oliverearl/php-hashnode.git
    ```
2. Install Composer packages

    ```
    composer install
    ```

This library will be made available for install via Composer once it has reached a more complete state.

Usage
-----

[](#usage)

After installation, the library is ready to use out-of-the-box. A client instance and GraphQL root query object can be made like thus:

```
$client = new Hashnode();

$query = new RootQuery();
```

If 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.**

```
$client = new Hashnode('https://some-alternative-endpoint.hashnode.com', [
  'Authorization' => 'my-api-key-goes-here'
]);
```

Remember 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:

*(Also, this is assuming you utilise 'use statements' and don't have to resolve namespaces fully.)*

```
$query->selectStoriesFeed((new RootStoriesFeedArgument())->setType('NEW'))
    ->selectTitle()
    ->selectDateAdded()
    ->selectAuthor((new AuthorArgument()))
    ->selectUsername();

$results = $client->runQuery($query->getQuery())->getData();
```

*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).*

Roadmap
-------

[](#roadmap)

The following is on the roadmap for upcoming releases:

- API behaviours that require an API key (creating, updating, deleting)
- Changes to make the library easier to use and potentially less dependent on the underlying GraphQL libraries
- Cleaner, less lasagna-like code
- Integration PHPUnit tests

Also, see the [open issues](https://github.com/oliverearl/php-hashnode/issues) for a list of user-proposed features (and known issues).

Contributing
------------

[](#contributing)

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are **greatly appreciated**.

### Particularly welcome contributions

[](#particularly-welcome-contributions)

- Bugfixes and beneficiary changes to existing functionality.
- New functionality that fulfills unimplemented areas of the API.
- Enhancements to existing or production of additional PHPUnit tests.
- Documentation, both in the source code and in the `docs` directory.
- Examples of the library in use within the `examples` directory.

### Instructions

[](#instructions)

1. Fork the Project
2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)
3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)
4. Push to the Branch (`git push origin feature/AmazingFeature`)
5. Open a Pull Request

Testing
-------

[](#testing)

The suite of PHPUnit tests can be run with `composer run test` at your terminal, assuming a full installation of Composer.

Alternatively, you can retrieve easy-to-read *testdox* by running `composer run testdox`.

License
-------

[](#license)

Distributed under the MIT License. See `LICENSE` for more information.

Contact
-------

[](#contact)

Oliver Earl -

Project Link:

Acknowledgements
----------------

[](#acknowledgements)

- [Mostafa Ghoneimy et al for the underpinning GraphQL technologies.](https://github.com/mghoneimy)
- [The amazing people over at Hashnode.](https://www.hashnode.com)
- [Hashnode's GraphQL API](https://api.hashnode.com)
- [Othneil Drew for the README template](https://github.com/othneildrew/Best-README-Template)

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance38

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 95.6% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~318 days

Total

4

Last Release

538d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/10ca9d5f46f753e8297ae6cc53c018fa833f9e1bc7785c6397a45e7fbc17f033?d=identicon)[oliverearl](/maintainers/oliverearl)

---

Top Contributors

[![oliverearl](https://avatars.githubusercontent.com/u/14837181?v=4)](https://github.com/oliverearl "oliverearl (109 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (5 commits)")

---

Tags

graphqlhashnodehashnode-apiphpapigraphqlhashnode

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/oliverearl-php-hashnode/health.svg)

```
[![Health](https://phpackages.com/badges/oliverearl-php-hashnode/health.svg)](https://phpackages.com/packages/oliverearl-php-hashnode)
```

###  Alternatives

[wp-graphql/wp-graphql-woocommerce

WooCommerce bindings for WPGraphQL

69146.8k](/packages/wp-graphql-wp-graphql-woocommerce)[alexaandrov/laravel-graphql-client

GraphQL client for laravel/lumen

125.6k](/packages/alexaandrov-laravel-graphql-client)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
