Download the PHP package garlic/graphql-wrapper without Composer
On this page you can find all versions of the php package garlic/graphql-wrapper. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download garlic/graphql-wrapper
More information about garlic/graphql-wrapper
Files in garlic/graphql-wrapper
Package graphql-wrapper
Short Description GraphQL wrapper bundle uses for communication among microservices through message bus (by default is RabbitMQ)
License MIT
Informations about the package graphql-wrapper
Garlic GraphQL wrapper
This bundle allow microservices communicate to each other using GraphQL query builder
Installation
Just a couple things are necessary for this bundle works.
Add garlic/bus bundle to your composer.json
GraphQL way to get result from service (several services)
Important: If you want to use GraphQL wrapper you have to install garlicservices/graphql-bundle on all the services you requiested in your queries. To install bundle on application just type in console the command showed below
Easy way to use GraphQl query
Simple example of querying data from remote microservice
``
Querying internal related objects
Example of querying data from related objects
Searching on internal related objects
Example of searching data on included objects
Querying external related objects (stitchOne)
Example of query stitching to one another by using stitchOne() method (stitched result will be included as an object)
Querying external related list of objects (stitchMany)
Example of stitching queries to one another by using stitchMany() method (stitched result will be included as list of objects)
Querying stitching by using internally included objects
Example of stitching queries with fields from internally included objects
Passing request headers
You could pass any headers you want just by using addHeader
method on created query:
GraphQL mutations
Mutation is the way to change service data by sending some kinds of query. What this queries are and how they could created read below.
Create new data with GraphQL mutation
Example of creating new data row on remote microservice. Method "set" put new fields data in a query and method "select" contains fields that will be returned after query done.
Update data with GraphQL mutation
Delete data with GraphQL mutation
Making async batch request with parallel processing
Query stitching in Mutation
Query stitching works the same way as in query mode. Just try, it's amazing!
Example of Create Mutation with next stitching to the query.
You can use stitching with query and mutation and vise-versa. Even several mutation can be stitched to one another.
Enjoy
All versions of graphql-wrapper with dependencies
garlic/bus Version 1.*
jms/serializer-bundle Version ^2.0
dflydev/dot-access-data Version ^2.0
ext-json Version *