Download the PHP package monkeyscloud/monkeyslegion-graphql without Composer
On this page you can find all versions of the php package monkeyscloud/monkeyslegion-graphql. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download monkeyscloud/monkeyslegion-graphql
More information about monkeyscloud/monkeyslegion-graphql
Files in monkeyscloud/monkeyslegion-graphql
Package monkeyslegion-graphql
Short Description Code-first GraphQL server for the MonkeysLegion framework — PHP 8.4 attributes, PSR-15, DataLoader, subscriptions, and security out of the box.
License MIT
Homepage https://monkeyslegion.com/docs/packages/graphql
Informations about the package monkeyslegion-graphql
MonkeysLegion-GraphQL
Code-first GraphQL server for the MonkeysLegion framework — PHP 8.4 attributes, PSR-15, DataLoader, subscriptions, and security out of the box.
Requirements
- PHP 8.4+
webonyx/graphql-php^15.30
Installation
The GraphQLProvider is auto-registered via composer.json extra.
Quick Start
1. Define a Type
2. Define a Query
3. Define a Mutation
4. Configure
Features
Attributes
| Attribute | Target | Purpose |
|---|---|---|
#[Type] |
Class | GraphQL object type |
#[Field] |
Method/Property | Object type field |
#[Query] |
Class | Root query field |
#[Mutation] |
Class | Root mutation field |
#[Subscription] |
Class | Subscription field |
#[Arg] |
Parameter | Argument metadata |
#[InputType] |
Class | Input object type |
#[Enum] |
Backed enum | Enum type |
#[InterfaceType] |
Class/Interface | Interface type |
#[UnionType] |
Class | Union type |
#[Middleware] |
Class/Method | Per-field middleware |
Custom Scalars
DateTime— ISO 8601 serializationJSON— Arbitrary JSON passthroughEmail— Email format validationURL— URL format validationUpload— Multipart file upload
Security
DataLoader (N+1 Prevention)
Relay Pagination
Subscriptions
Supports graphql-ws protocol with in-memory and Redis PubSub backends.
File Uploads
Follows the GraphQL multipart request spec:
CLI Commands
| Command | Description |
|---|---|
php ml graphql:schema:dump |
Dump schema as SDL |
php ml graphql:schema:validate |
Validate schema |
php ml graphql:cache:warm |
Warm schema cache |
php ml graphql:cache:clear |
Clear schema cache |
php ml graphql:introspect |
Dump introspection JSON |
Entity Integration
When monkeyslegion-entity is installed, you can auto-map your entities to GraphQL types without writing boilerplate type classes.
Entity Example
Auto-Map Entities to GraphQL Types
Auto-Generated CRUD Resolvers
Use EntityResolver to expose entities without manual resolver classes:
Full Example: Entity-Backed Schema
Route Registration
GraphQLProvider automatically registers routes with monkeyslegion-router when the application boots.
Default Routes
| Method | Path | Handler | Description |
|---|---|---|---|
POST |
/graphql |
GraphQLMiddleware |
Queries & mutations |
GET |
/graphql |
GraphQLMiddleware |
Simple GET queries |
GET |
/graphiql |
GraphiQLMiddleware |
Interactive IDE (dev) |
Configuration
How Route Registration Works
The GraphQLProvider::register() method is called automatically during application bootstrap (via the monkeyslegion extra in composer.json). Here's what happens:
Custom Route Middleware
Stack your own middleware (auth, CORS, rate-limiting) alongside GraphQL:
Testing the Endpoint
Facade
License
MIT — see LICENSE for details.
All versions of monkeyslegion-graphql with dependencies
webonyx/graphql-php Version ^15.32
psr/http-message Version ^2.0
psr/http-server-middleware Version ^1.0
psr/simple-cache Version ^3.0
psr/container Version ^2.0
nyholm/psr7 Version ^1.8
monkeyscloud/monkeyslegion-core Version ^2.0
monkeyscloud/monkeyslegion-di Version ^2.0
monkeyscloud/monkeyslegion-router Version ^2.0
monkeyscloud/monkeyslegion-mlc Version ^2.0
monkeyscloud/monkeyslegion-cli Version ^2.0