mirror of
https://github.com/retailcrm/graphql-php.git
synced 2025-02-06 07:49:24 +03:00
Adrien Crivelli
11c9429fab
Support non pre-parsed PSR-7 request body
Because PSR-7 specification only specify that `getParsedBody()` **may** return the parsed body for `application/json`, we cannot assume that it is always the case. So if the value returned parsed body is an empty array, it means we should try to parse it ourselves (`null` would mean no body at all according to spec). With this modification we try to used given parsed body, but fallback on trying to parse the body if necessary. This leave the door open to custom implementation of parsing if needed, while making it easier to use out of the box.
graphql-php
This is a PHP implementation of the GraphQL specification based on the reference implementation in JavaScript.
Installation
Via composer:
composer require webonyx/graphql-php
Documentation
Full documentation is available on the Documentation site as well as in the docs folder of the distribution.
If you don't know what GraphQL is, visit this official website by the Facebook engineering team.
Examples
There are several ready examples in the examples folder of the distribution with specific README file per example.
Contribute
Please refer to CONTRIBUTING.md for information on how to contribute.
Old README.md
Here is a link to the old README.md.
Keep in mind that it relates to the version 0.9.x. It may contain outdated information for newer versions (even though we try to preserve backwards compatibility).
Languages
PHP
100%