PHPackages                             x-graphql/http-schema - 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. x-graphql/http-schema

ActiveLibrary[API Development](/categories/api)

x-graphql/http-schema
=====================

Building GraphQL schema over HTTP (aka remote schema)

0.9.0(2y ago)151.1k↑11.1%2MITPHPPHP &gt;=8.2

Since Feb 16Pushed 2y agoCompare

[ Source](https://github.com/x-graphql/http-schema)[ Packagist](https://packagist.org/packages/x-graphql/http-schema)[ RSS](/packages/x-graphql-http-schema/feed)WikiDiscussions main Synced 2w ago

READMEChangelog (10)Dependencies (14)Versions (13)Used By (2)

HTTP Schema
===========

[](#http-schema)

[![unit tests](https://github.com/x-graphql/http-schema/actions/workflows/unit_tests.yml/badge.svg)](https://github.com/x-graphql/http-schema/actions/workflows/unit_tests.yml/badge.svg)[![codecov](https://camo.githubusercontent.com/8124471f6cabc7f8f79c860cd532b4422dca35cbce3840db078f1ff71c3cdbf8/68747470733a2f2f636f6465636f762e696f2f67682f782d6772617068716c2f687474702d736368656d612f67726170682f62616467652e7376673f746f6b656e3d416c695a6b5854623445)](https://codecov.io/gh/x-graphql/http-schema)

Help to build and execute [GraphQL schema](https://webonyx.github.io/graphql-php/) over HTTP (aka remote schema).

Getting Started
---------------

[](#getting-started)

Install this package via [Composer](https://getcomposer.org)

```
composer require x-graphql/http-schema
```

This library require [PSR-18 Client](https://www.php-fig.org/psr/psr-18/) or [Httplug Async Client](https://docs.php-http.org/en/latest/index.html) for sending async requests. Run the command bellow if you don't have yet.

```
composer require php-http/guzzle7-adapter
```

Usages
------

[](#usages)

This library offers to you 2 strategy to build schema:

- Build from schema definition language (SDL), this strategy use for limiting fields user can access.
- Build from introspection query, with this strategy it will make a http request for [introspecting schema](https://graphql.org/learn/introspection/), user can access all the fields.

### From SDL

[](#from-sdl)

```
use GraphQL\GraphQL;
use XGraphQL\HttpSchema\HttpDelegator;
use XGraphQL\HttpSchema\HttpSchemaFactory;

$delegator = new HttpDelegator('https://countries.trevorblades.com/');
$schema = HttpSchemaFactory::createFromSDL(
$delegator,
toArray());
```

### From introspection query

[](#from-introspection-query)

```
use GraphQL\GraphQL;
use XGraphQL\HttpSchema\HttpDelegator;
use XGraphQL\HttpSchema\HttpSchemaFactory;

$delegator = new HttpDelegator('https://countries.trevorblades.com/');
$schema = HttpSchemaFactory::createFromIntrospectionQuery($delegator);
$result = GraphQL::executeQuery($schema, 'query { countries { name } }');

var_dump($result->toArray());
```

### Caching schema

[](#caching-schema)

For optimizing time to build schema from SDL or introspection query, you can put [PSR-16](https://www.php-fig.org/psr/psr-16/) instance to factory methods for caching schema after built:

```
use XGraphQL\HttpSchema\HttpDelegator;
use XGraphQL\HttpSchema\HttpSchemaFactory;

/// $psr16Cache = ....
$delegator = new HttpDelegator('https://countries.trevorblades.com/');
$schemaFromSDL = HttpSchemaFactory::createFromSDL($delegator, /// $sdl, $psr16Cache);
$schemaFromIntrospection = HttpSchemaFactory::createFromIntrospectionQuery($delegator, /// $psr16Cache);

/// ........
```

Credits
-------

[](#credits)

Created by [Minh Vuong](https://github.com/vuongxuongminh)

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity32

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity52

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

Every ~5 days

Total

12

Last Release

860d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8901d64a1059726b851dbdd91463ad1d3169f9dba6a2dcff11d05f97d9bccaea?d=identicon)[vuongxuongminh](/maintainers/vuongxuongminh)

---

Top Contributors

[![vuongxuongminh](https://avatars.githubusercontent.com/u/38932626?v=4)](https://github.com/vuongxuongminh "vuongxuongminh (46 commits)")

###  Code Quality

TestsPHPUnit

Code StyleECS

### Embed Badge

![Health badge](/badges/x-graphql-http-schema/health.svg)

```
[![Health](https://phpackages.com/badges/x-graphql-http-schema/health.svg)](https://phpackages.com/packages/x-graphql-http-schema)
```

###  Alternatives

[telnyx/telnyx-php

Official Telnyx PHP SDK — APIs for Voice, SMS, MMS, WhatsApp, Fax, SIP Trunking, Wireless IoT, Call Control, and more. Build global communications on Telnyx's private carrier-grade network.

36826.2k2](/packages/telnyx-telnyx-php)[flow-php/flow

PHP ETL - Extract Transform Load - Data processing framework

86337.5k](/packages/flow-php-flow)[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.5k6.0M777](/packages/sylius-sylius)[tempest/framework

The PHP framework that gets out of your way.

2.3k37.6k21](/packages/tempest-framework)[getbrevo/brevo-php

Official PHP SDK for the Brevo API.

1004.1M59](/packages/getbrevo-brevo-php)[gotenberg/gotenberg-php

A PHP client for interacting with Gotenberg, a developer-friendly API for converting numerous document formats into PDF files, and more!

3906.6M34](/packages/gotenberg-gotenberg-php)

PHPackages © 2026

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