PHPackages                             amin3mej/yii2-graphql-data-provider - 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. amin3mej/yii2-graphql-data-provider

ActiveLibrary[API Development](/categories/api)

amin3mej/yii2-graphql-data-provider
===================================

A data-provider that can used for connect to a graphql server.

v0.1.0(7y ago)51.2k↑171.9%GPL-3.0-or-laterPHPPHP &gt;=5.4.0

Since Jul 5Pushed 6y agoCompare

[ Source](https://github.com/amin3mej/yii2-graphql-data-provider)[ Packagist](https://packagist.org/packages/amin3mej/yii2-graphql-data-provider)[ Docs](https://amin3mej.github.io)[ RSS](/packages/amin3mej-yii2-graphql-data-provider/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (1)Versions (2)Used By (0)

 [ ![](https://avatars0.githubusercontent.com/u/993323) ](https://github.com/yiisoft)

Yii2 GraphQL Data-Provider Extension
====================================

[](#yii2-graphql-data-provider-extension)

A helper for GraphQL that include QueryHelper and ActiveDataProvider for Yii2.

[![Latest Stable Version](https://camo.githubusercontent.com/9b04bddd92e3e358c4b681d8fbf6996d53fef7de73c6db1825093ec76d9c7fc8/68747470733a2f2f706f7365722e707567782e6f72672f616d696e336d656a2f796969322d6772617068716c2d646174612d70726f76696465722f762f737461626c65)](https://packagist.org/packages/amin3mej/yii2-graphql-data-provider) [![Total Downloads](https://camo.githubusercontent.com/698f034880eeb4df972f84dea924a49ccedfe2dc97362336bae99b8f0076b719/68747470733a2f2f706f7365722e707567782e6f72672f616d696e336d656a2f796969322d6772617068716c2d646174612d70726f76696465722f646f776e6c6f616473)](https://packagist.org/packages/amin3mej/yii2-graphql-data-provider) [![License](https://camo.githubusercontent.com/fc2b105479f1ca664a1d4fd8e35e934c20da87188e30e7371f6a93fd698c232b/68747470733a2f2f706f7365722e707567782e6f72672f616d696e336d656a2f796969322d6772617068716c2d646174612d70726f76696465722f6c6963656e7365)](https://packagist.org/packages/amin3mej/yii2-graphql-data-provider)

Installation
------------

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
php composer.phar require --prefer-dist amin3mej/yii2-graphql-data-provider "*"
```

or add

```
"amin3mej/yii2-graphql-data-provider": "*"

```

to the require section of your composer.json.

Configuration
-------------

[](#configuration)

**Component Setup**

To access Query Component, you need to configure the components array in your application configuration:

```
'components' => [
    'graphql' => [
        'class' => 'amin3mej\graphql\GraphqlQuery',
        'defaultTarget' => [
            'github' => 'https://api.github.com/graphql',
            'graphqlhub' => 'https://www.graphqlhub.com/graphql',
        ],
        'customHeaders' => [
            'Content-Type' => 'application/graphql',
            'github' => [
                'Authorization' => 'Bearer ' . $params['github.graphqlToken'],
            ],
        ],
    ],
],
```

You can define your targets here to access them fast from your code.

Also you can define some headers here to add to the requests. if you fine a key directly in array, the key recognized as common header and It will send with all request. if you define an array with the same name with your target, it headers will used only for the target.

By default there are two headers:

```
[
    'Accept' => 'application/json',
    'Content-Type' => 'application/json'
]

```

But you can override them, by giving new headers with the same Array keys.

Usage:
------

[](#usage)

**Query:**

```
const QUERY_CHECK =  (int) $userId], 'github');
```

**ActiveDataProvider:**

```
use amin3mej\graphql\GraphqlDataProvider;

// If you want to use pagination in ActiveDataProvider, Set $offset and $limit in your query. Everything will be handled automatically.
const QUERY =  QUERY,
    'queryCallback' => 'data.categories', // How to access the array in responded query result? More: https://www.yiiframework.com/doc/guide/2.0/en/helper-array#getting-values
    'totalCountQuery' => 'query { categoriesConnection { aggregate { count } } }',
    'target' => 'prisma',
]);

return $this->render('index', [
    'dataProvider' => $dataProvider,
]);
```

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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

Unknown

Total

1

Last Release

2557d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/4997188?v=4)[Syd Djawadi](/maintainers/amin3mej)[@amin3mej](https://github.com/amin3mej)

---

Top Contributors

[![amin3mej](https://avatars.githubusercontent.com/u/4997188?v=4)](https://github.com/amin3mej "amin3mej (12 commits)")

---

Tags

activedataproviderdata-providergraphqlqueryhelperyii2phpgraphqlyii2yii2 graphql data provideryii2-data-provider

### Embed Badge

![Health badge](/badges/amin3mej-yii2-graphql-data-provider/health.svg)

```
[![Health](https://phpackages.com/badges/amin3mej-yii2-graphql-data-provider/health.svg)](https://phpackages.com/packages/amin3mej-yii2-graphql-data-provider)
```

###  Alternatives

[craftcms/cms

Craft CMS

3.6k3.6M3.1k](/packages/craftcms-cms)[jianyan74/yii2-easy-wechat

WeChat SDK for yii2, 基于 overtrue/easywechat

14340.0k1](/packages/jianyan74-yii2-easy-wechat)

PHPackages © 2026

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