PHPackages                             vahidirn/laravel-graphql - 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. vahidirn/laravel-graphql

ActiveLibrary

vahidirn/laravel-graphql
========================

Define GraphQL schema for connection filtering using Laravel filterQuery models

056PHP

Since Jan 16Pushed 7y agoCompare

[ Source](https://github.com/vahidirn/laravel-graphql)[ Packagist](https://packagist.org/packages/vahidirn/laravel-graphql)[ RSS](/packages/vahidirn-laravel-graphql/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

VahidIrn\\GraphQLFilter
=======================

[](#vahidirngraphqlfilter)

Define GraphQL schema for connection filtering using Laravel filterQuery models.

Installation
============

[](#installation)

```
composer require vahidirn/laravel-graphql

```

Usage
=====

[](#usage)

Use FilterQuery trait on Model

```
namespace App;
use VahidIrn\FilterQuery\FilterQuery;

class User extends Model
{
  use \VahidIrn\FilterQuery\FilterQueryTrait;

  protected $filterQuery = [
    'name' => FilterQuery::String
  ];
}

```

Create GraphQL User type

```
namespace App\GraphQL\Type;

use App\User;
use GraphQL\Type\Definition\Type;
use Folklore\GraphQL\Support\Type as GraphQLType;

class User extends GraphQLType
{
  protected $attributes = [
    'name' => 'User'
  ];
  public function fields() {
    return [
      'id' => [
        'type' => Type::id(),
      ],
      'name' => [
        'type' => Type::string()
      ]
    ]
  }
}

```

Create GraphQL UserFilter type. The UserFilter fields defintion will be automatically populated with fields in `User::$filterQuery`.

```
namespace App\GraphQL\Type;

use App\User;
use VahidIrn\GraphQLFilter\Type\FilterType;

class UserFilter extends FilterType
{
  protected $model = User::class;
}

```

Create GraphQL query type to list User records using the User model's filterQuery settings.

```
namespace App\GraphQL\Type;

use App\User;
use GraphQL;
use GraphQL\Type\Definition\Type;
use Folklore\GraphQL\Support\Query;

class UsersQuery extends Query
{
  protected $attributes = [
    'name' => 'users'
  ];
  public function type() {
    return Type::listOf(GraphQL::type('User'));
  }
  public function args() {
    return [
      'filter' => [
        'type' => GraphQL::type('UserFilter')
      ]
    ];
  }
  public function resolve($root, $args, $context) {
    return User::filter($args['filter'])->orderBy('name')->limit(10)->get();
  }
}

```

A GraphQL query can now use the `FilterQuery::String` rules to perform searches.

```
query Users {
  users (filter: { name_MATCH: 'vahid' }) {
    name
  }
}

```

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/be9599dbdfcc1413c6c3538c3bda14da9dc1aa21718647955c16ee674d1bf971?d=identicon)[vahidirn](/maintainers/vahidirn)

---

Top Contributors

[![vahidirn](https://avatars.githubusercontent.com/u/24313370?v=4)](https://github.com/vahidirn "vahidirn (3 commits)")

### Embed Badge

![Health badge](/badges/vahidirn-laravel-graphql/health.svg)

```
[![Health](https://phpackages.com/badges/vahidirn-laravel-graphql/health.svg)](https://phpackages.com/packages/vahidirn-laravel-graphql)
```

PHPackages © 2026

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