PHPackages                             rdx/graphql-query - 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. rdx/graphql-query

ActiveLibrary[API Development](/categories/api)

rdx/graphql-query
=================

Builds GraphQL queries

1.1(7y ago)15222.2k↓30.1%7[2 issues](https://github.com/rudiedirkx/graphql-query/issues)2MITPHP

Since Jun 22Pushed 6y ago1 watchersCompare

[ Source](https://github.com/rudiedirkx/graphql-query)[ Packagist](https://packagist.org/packages/rdx/graphql-query)[ RSS](/packages/rdx-graphql-query/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (3)Used By (2)

GraphQL query builder
=====================

[](#graphql-query-builder)

Build a query:

```
$query = Query::query('TestQueryWithEverything');
$query->defineFragment('userStuff', 'User');
$query->userStuff->fields('id', 'name', 'path');
$query->fields('scope', 'friends', 'viewer');
$query->friends->attribute('names', ['marc', 'jeff']);
$query->friends->fields('id', 'name', 'picture');
$query->friends->picture->attribute('size', 50);
$query->viewer->fields('...userStuff', 'repos');
$query->viewer->repos
	->attribute('public', true)
	->attribute('limit', 10)
	->attribute('order', ['field' => Query::enum('STARS'), 'direction' => Query::enum('DESC')]);
$query->viewer->repos->fields('id', 'path');
$query->viewer->repos->fragment('PublicRepo')->fields('stars');
$query->viewer->repos->fragment('PrivateRepo')->fields('status', 'permissions', 'members');
$query->viewer->repos->PrivateRepo->members->fields('...userStuff');

```

Render it:

```
$string = $query->build();

```

Results in:

```
query TestQueryWithEverything {
  scope
  friends(names: ["marc","jeff"]) {
    id
    name
    picture(size: 50)
  }
  viewer {
    ...userStuff
    repos(public: true, limit: 10, order: {field: STARS, direction: DESC}) {
      ... on PublicRepo {
        stars
      }
      ... on PrivateRepo {
        status
        permissions
        members {
          ...userStuff
        }
      }
      id
      path
    }
  }
}

fragment userStuff on User {
  id
  name
  path
}

```

Mutations
---------

[](#mutations)

Since Mutations are practically the same as Queries, it has the same exact semantics:

```
$query = Query::mutation();
$query->field('moveProjectCard')->attribute('input', ['cardId' => 123, 'columnId' => 456]);
$query->moveProjectCard->fields('clientMutationId');

```

makes:

```
mutation {
  moveProjectCard (input: {cardId: 123, columnId: 456}) {
    clientMutationId
  }
}

```

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance17

Infrequent updates — may be unmaintained

Popularity43

Moderate usage in the ecosystem

Community17

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 80% 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 ~526 days

Total

2

Last Release

2725d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/78549c1dc5c83ec0201c9afc66762c6d5bbf770291b12bae5a7a65350f950dba?d=identicon)[rudiedirkx](/maintainers/rudiedirkx)

---

Top Contributors

[![rudiedirkx](https://avatars.githubusercontent.com/u/168024?v=4)](https://github.com/rudiedirkx "rudiedirkx (12 commits)")[![petrmelnikov](https://avatars.githubusercontent.com/u/34571405?v=4)](https://github.com/petrmelnikov "petrmelnikov (2 commits)")[![CasperLaiTW](https://avatars.githubusercontent.com/u/5094008?v=4)](https://github.com/CasperLaiTW "CasperLaiTW (1 commits)")

### Embed Badge

![Health badge](/badges/rdx-graphql-query/health.svg)

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

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[facebook/php-business-sdk

PHP SDK for Facebook Business

90821.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

74513.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

265103.1M454](/packages/google-gax)[google/common-protos

Google API Common Protos for PHP

173103.7M50](/packages/google-common-protos)

PHPackages © 2026

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