Download the PHP package phps-cans/harmony-graphql-tool without Composer
On this page you can find all versions of the php package phps-cans/harmony-graphql-tool. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download phps-cans/harmony-graphql-tool
More information about phps-cans/harmony-graphql-tool
Files in phps-cans/harmony-graphql-tool
Package harmony-graphql-tool
Short Description This package contains tools to be able to easily implement graphql in your application
License MIT
Homepage https://github.com/phps-cans/harmony-graphql-tool
Informations about the package harmony-graphql-tool
harmony-graphql-tool
This package try to make the using of webonyx's Graphql implementation easyer when using PSR 11's container. To be easyer you must use ServiceProvider
It provides :
- A Type Registry. This is intented to register Type and not query. What it does? It ask to the container if the Type asked by object is registered, else it use the Type name asked as a Classname (removing
Type
at the end of the Type asked if it exist). If the Type as a class using his name, it check if it implementsGraphqlTypeInterface
, if it does it use this type. GraphqlQueryInterface
: All query's object should implements this interface to be able to be register into the schemaGraphqlTypeInterface
: All type's object should implements this interface to be discovered by the Type RegistryDefaultServiceProvider
: A service provider which create a graphql's server / a schema automatically
How to use
Using ServiceProvider
You must register the identifier's name list of instance of your query object (implementing \PsCs\Harmony\Graphql\Tool\GraphqlQueryInterface
) under the name PsCs\Harmony\Graphql\Tool\GraphqlQueryInterface
.
By example:
-
First define your TypeClass:
- Secondly, create your Query object:
Alternatively, you can create an object which returns multiple query:
- Then create your serviceProvider
Then register service provider needed:
Without service provider
This package attempt to make easy the use of the library with service provider. If you do not use the service provider, this package cannot register automatically instances. You still can use the Registry
class:
TODO
Implements type discovery using doctrine's annotation
All versions of harmony-graphql-tool with dependencies
container-interop/service-provider Version ~0.3.0
container-interop/container-interop Version ^1.0
webonyx/graphql-php Version ^0.10