PHPackages                             diasfs/graphql-php-resolvers - 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. diasfs/graphql-php-resolvers

ActiveLibrary[API Development](/categories/api)

diasfs/graphql-php-resolvers
============================

Directive and Field resolvers for graphql-php

1.0.1(7y ago)1159[1 issues](https://github.com/diasfs/graphql-php-resolvers/issues)MITPHP

Since Feb 12Pushed 7y ago1 watchersCompare

[ Source](https://github.com/diasfs/graphql-php-resolvers)[ Packagist](https://packagist.org/packages/diasfs/graphql-php-resolvers)[ RSS](/packages/diasfs-graphql-php-resolvers/feed)WikiDiscussions master Synced 2w ago

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

GraphQL Resolvers
=================

[](#graphql-resolvers)

[![License](https://camo.githubusercontent.com/ec34e22eb182c733cbbe100730a05a4a6cd89c28e2b0f5513aad6ad6a1e01b58/68747470733a2f2f706f7365722e707567782e6f72672f65636f6465762f6772617068716c2d75706c6f61642f6c6963656e73652e706e67)](https://packagist.org/packages/diasfs/graphql-php-resolvers)

Simplified resolvers for [webonyx/graphql-php](https://github.com/webonyx/graphql-php).

Quick start
-----------

[](#quick-start)

Install the library via composer:

```
composer require diasfs/graphql-php-resolvers
```

### Field Resolver

[](#field-resolver)

```
require __DIR__ . "/vendor/autoload.php";
use GraphQL\Utils\BuildSchema;
use GraphQL\GraphQL;
use GraphQL\Resolvers\FieldResolver;

$schema_gql =  array(
        'hello' => "Hello World!"
    )
);

$schema = BuildSchema::build($schema_gql, function($typeConfig) use ($data) {

    return FieldResolver::TypeConfigDecorator($typeConfig, function($type_name, $field_name) use ($data) {
        return $data[$type_name][$field_name];
    });

});

$query =  Hello World!
        )
)
```

### Directive Resolver

[](#directive-resolver)

```
require __DIR__ . "/vendor/autoload.php";
use GraphQL\Utils\BuildSchema;
use GraphQL\GraphQL;
use GraphQL\Resolvers\FieldResolver;
use GraphQL\Resolvers\DirectiveResolver;

$schema_gql =  array(
        'hello' => "Hello",
        'world' => "World",
    )
);

$schema = BuildSchema::build($schema_gql, function($typeConfig) use ($data) {

    return FieldResolver::TypeConfigDecorator($typeConfig, function($type_name, $field_name) use ($data) {
        return $data[$type_name][$field_name];
    });

});

$directives = array(
    'upper' => function($next, $directiveArgs, $value, $args, $context, $info) {
        return $next($value, $args, $ctx, $info)->then(function($str) {
            return strtolupper($str);
        });
    },
    'lower' => function($next, $directiveArgs, $value, $args, $context, $info) {
        return $next($value, $args, $ctx, $info)->then(function($str) {
            return strtolower($str);
        });
    }
);

DirectivesResolver::bind($schema, function($name) use ($directives) {
    return $directives[$name];
});

$query =  HELLO
            [world] => world
        )
)
```

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity62

Established project with proven stability

 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

Every ~0 days

Total

2

Last Release

2696d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1634828?v=4)[Fábio Dias](/maintainers/diasfs)[@diasfs](https://github.com/diasfs)

---

Top Contributors

[![diasfs](https://avatars.githubusercontent.com/u/1634828?v=4)](https://github.com/diasfs "diasfs (2 commits)")

### Embed Badge

![Health badge](/badges/diasfs-graphql-php-resolvers/health.svg)

```
[![Health](https://phpackages.com/badges/diasfs-graphql-php-resolvers/health.svg)](https://phpackages.com/packages/diasfs-graphql-php-resolvers)
```

###  Alternatives

[aws/aws-sdk-php

AWS SDK for PHP - Use Amazon Web Services in your PHP project

6.2k532.1M2.5k](/packages/aws-aws-sdk-php)[guzzlehttp/guzzle

Guzzle is a PHP HTTP client library

23.5k1.0B34.5k](/packages/guzzlehttp-guzzle)[laravel/framework

The Laravel Framework.

34.8k543.8M19.5k](/packages/laravel-framework)[google/gax

Google API Core for PHP

267116.3M528](/packages/google-gax)[saloonphp/saloon

Build beautiful API integrations and SDKs with Saloon

2.4k11.8M658](/packages/saloonphp-saloon)[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k15.1M125](/packages/laravel-pulse)

PHPackages © 2026

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