Download the PHP package phonetworks/pho-lib-graphql-parser without Composer
On this page you can find all versions of the php package phonetworks/pho-lib-graphql-parser. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download phonetworks/pho-lib-graphql-parser
More information about phonetworks/pho-lib-graphql-parser
Files in phonetworks/pho-lib-graphql-parser
Package pho-lib-graphql-parser
Short Description A general purpose GraphQL parser library in PHP
License MIT
Homepage https://phonetworks.org
Informations about the package pho-lib-graphql-parser
pho-lib-graphql-parser
A general purpose GraphQL schema parser library in PHP. This library does not parse GraphQL queries or responses.
Installation
The recommended way to install pho-lib-graphql-parser is through composer. It's as simple as:
Usage
Suppose you have the following GraphQL schema file as :
Then, you can parse it via:
Please note, for argument values, we currently support String only.
A note on multiple inheritance
As of version 3.0, this is a pure PHP library. However, you may want to enable C extensions in case you need "multiple inheritance" which is not currently supported in the pure PHP mode.
For multiple inheritance, the following dependencies must be met before installing pho-lib-graphql-parser. Please note, the patches shown must be applied since schema support is still experimental.
- The LibGraphQLParser library by Facebook. Make sure the experimental schema support is enabled with this patch.
- The graphql-parser-php PHP extension. Make sure the experimental schema support is enabled with this patch.
To enable it in the library side, you need to set an environment variable where this program is run as follows:
LIBGRAPHQL_ON=true
Once you do that, you may test multiple inheritance by commenting out "return" statements in the tests/SchemaWithMultipleInheritanceTest.php file.
License
Released under the terms of the permissive MIT license.