⚡🌐⚡ Easy-to-use & Fast GraphQL server implementation for PHP.
Feature complete PHP implementation of GraphQL server. Its job is transformation of query string into resolved Json result for a given Schema.
- Aims to be compliant with the latest draft of GraphQL specification and its RFCs.
- Fully typesafe, and therefore minimum required PHP version is 8.1. Sacrifices a tiny bit of convenience for huge amount of clarity and safety - no random configuration
array
s, no mixed types, no variable function arguments - this library doesnt try to save you from verbosity, but makes sure you always know what you've got. - Code first.
- Flexible. Easy to extend with extra functionality using Modules or middleware Directives.
- Includes some opt-in extensions which are out of scope of official specs:
Name | Version | Description |
---|---|---|
Printer | Schema printing for GraPHPinator typesystem. | |
Extra types | Some useful directives and commonly used types, both scalar or composite. | |
Constraint directives | Typesystem directives to declare additional validation on top of GraphQL typesystem. | |
Where directives | Executable directives to filter values in lists. | |
Upload | Module to handle multipart-formdata requests. | |
Query cost | Modules to limit query cost by restricting maximum depth or number of nodes. | |
Persisted queries | Module to persist validated query in cache and improve performace of repeating queries. |
- Includes adapters for easy integration into other PHP frameworks:
Name | Version | Description |
---|---|---|
PSR | Bundled | |
Symfony | Adapters for Symfony framework. | |
Nette | Adapters for Nette framework. |
- Project is composed of multiple smaller packages, which may be used standalone:
Name | Version | Description |
---|---|---|
Source | Wrapper around source document. | |
Tokenizer | Lexical analyzer of GraphQL document. | |
Parser | Syntactic analyzer of GraphQL document. |
This project is being made with help by following companies and individuals. Thank you!
Install package using composer
composer require infinityloop-dev/graphpinator
- Visit our simple Hello world example.
- Or visit the complete Docs.
- PHP 8.1+
- Latest PHP 8.0+ version is 1.3.x
- Latest PHP 7.4+ version is 0.25.x
- psr/http-message
- psr/log
This list excludes graphpinator sub-packages such as graphpinator-common, graphpinator-tokenizer and others.
This package is relatively new, so some features might be missing. If you stumble upon something that is not included or is not compliant with the specs, please inform us by creating an issue or discussion. This is not yet another package, where issues and pull-requests lie around for months, so dont hesitate and help us improve the library.