PHPackages                             phrity/websocket-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. [HTTP &amp; Networking](/categories/http)
4. /
5. phrity/websocket-graphql

ActiveLibrary[HTTP &amp; Networking](/categories/http)

phrity/websocket-graphql
========================

WebSocket GraphQL server

1.0.1(5mo ago)03MITPHPPHP ^8.1CI passing

Since Jun 25Pushed 5mo agoCompare

[ Source](https://github.com/sirn-se/phrity-websocket-graphql)[ Packagist](https://packagist.org/packages/phrity/websocket-graphql)[ Docs](https://phrity.sirn.se/websocket-graphql)[ RSS](/packages/phrity-websocket-graphql/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (7)Versions (3)Used By (0)

[![Phrity Websocket GraphQL](docs/logotype.png)](docs/logotype.png)

Websocket GraphQL Server for PHP
================================

[](#websocket-graphql-server-for-php)

[![Build Status](https://github.com/sirn-se/phrity-websocket-graphql/actions/workflows/acceptance.yml/badge.svg)](https://github.com/sirn-se/phrity-websocket-graphql/actions)

This library provides a GraphQL server over WebSocket.

It connects two popular and well developed libraries to achieve a competent and highly configurable server.

- [phrity/websocket](https://packagist.org/packages/phrity/websocket) for WebSocket server
- [webonyx/graphql-php](https://packagist.org/packages/webonyx/graphql-php) for GraphQL API

Installing
----------

[](#installing)

Preferred way to install is with [Composer](https://getcomposer.org/).

```
composer require phrity/websocket-graphql

```

Setup
-----

[](#setup)

You only need to create a GraphQL server config and add it to the middleware provided by this library.

```
// Setup GraphQL server configuration with schema etc
$serverConfig = GraphQL\Server\ServerConfig::create([
    'schema' => $schema,
]);

// Setup WebSocket server with the GraphQL middleware
$server = new WebSocket\Server($port, $ssl);
$server
    ->addMiddleware(new WebSocket\Middleware\CloseHandler())
    ->addMiddleware(new WebSocket\Middleware\PingResponder())
    ->addMiddleware(new Phrity\WebSocket\GraphQL\Middleware($serverConfig))
    ;

// Run the server - the middleware will respond to requests
$server->start();
```

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance71

Regular maintenance activity

Popularity3

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity46

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 ~163 days

Total

2

Last Release

164d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/4255391?v=4)[Sören Jensen](/maintainers/sirn-se)[@sirn-se](https://github.com/sirn-se)

---

Top Contributors

[![sirn-se](https://avatars.githubusercontent.com/u/4255391?v=4)](https://github.com/sirn-se "sirn-se (5 commits)")

---

Tags

graphqlphpphp-libraryserverwebsocketgraphqlserverwebsocket

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/phrity-websocket-graphql/health.svg)

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

###  Alternatives

[cboden/ratchet

PHP WebSocket library

6.4k21.4M239](/packages/cboden-ratchet)[hhxsv5/laravel-s

🚀 LaravelS is an out-of-the-box adapter between Laravel/Lumen and Swoole.

3.9k676.0k10](/packages/hhxsv5-laravel-s)[swow/swow

Coroutine-based multi-platform support engine with a focus on concurrent I/O

1.3k2.1M84](/packages/swow-swow)[phrity/websocket

WebSocket client and server

2184.1M27](/packages/phrity-websocket)[amphp/websocket-server

Websocket server for Amp's HTTP server.

124265.1k20](/packages/amphp-websocket-server)[morozovsk/websocket

simple php websocket server with examples and demo: simple chat (single daemon) - http://sharoid.ru/chat.html , pro chat (master + worker) - http://sharoid.ru/chat2.html , simple game - http://sharoid.ru/game.html

36417.3k2](/packages/morozovsk-websocket)

PHPackages © 2026

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