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. [API Development](/categories/api)
4. /
5. vahidirn/laravel-graphql

ActiveLibrary[API Development](/categories/api)

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 2w ago

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 13% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity39

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://avatars.githubusercontent.com/u/24313370?v=4)[vahidirn](/maintainers/vahidirn)[@vahidirn](https://github.com/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)
```

###  Alternatives

[exsyst/swagger

A php library to manipulate Swagger specifications

35816.3M7](/packages/exsyst-swagger)[hubspot/api-client

Hubspot API client

24015.5M18](/packages/hubspot-api-client)[pocketmine/bedrock-protocol

An implementation of the Minecraft: Bedrock Edition protocol in PHP

172437.8k11](/packages/pocketmine-bedrock-protocol)[botman/driver-telegram

Telegram driver for BotMan

94452.6k6](/packages/botman-driver-telegram)

PHPackages © 2026

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