2017 © Pedro Peláez
 

library graphql-client

Client to make graphql requests

image

convenia/graphql-client

Client to make graphql requests

  • Monday, April 23, 2018
  • by euventura
  • Repository
  • 4 Watchers
  • 8 Stars
  • 476 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 6 Versions
  • 21 % Grown

The README.md

PHP GraphQL Client

This package allows you to make GraphQL requests using pure PHP., (*1)

Implementation

The package has two basic classes, Query and Mutation that needs to be used when implementing a query or a mutation. In both cases you need to pass an instance of GuzzleHttp\Client and the base url. Every query or mutation needs also to set the name and desired output parameters., (*2)

Example


use Convenia\GraphQLClient\Mutation; class UpdateUserMutation extends Mutation { protected $queryName = 'createUser'; protected $outputParams = [ 'id', 'name', 'last_name' ]; }

Usage

When calling the mutation's methods you can choose between using the output params setted in the model, or you can also pass the desired params., (*3)

Example

class User
{
    protected $client = new GuzzleHttp\Client();

    protected $baseUrl = 'http://www.mygraphqlapi/v1/graphql'

    public static function create($userId, $data, $returnParams = [])
    {
        $mutation = new UpdateUserMutation($this->baseUrl);

        $mutation->update($userId, $data, $returnParams);
    }
}

Responses

This package has a handler that deals with the response. This response class also deals with the possible GraphQL errors., (*4)

The Versions

23/04 2018

dev-master

9999999-dev

Client to make graphql requests

  Sources   Download

The Requires

 

The Development Requires

by Tauan Lemos

28/03 2018

2

2.0.0.0

Client to make graphql requests

  Sources   Download

The Requires

 

The Development Requires

by Tauan Lemos

27/03 2018

1.2

1.2.0.0

Client to make graphql requests

  Sources   Download

The Requires

 

The Development Requires

by Tauan Lemos

09/03 2018

1.1

1.1.0.0

Client to make graphql requests

  Sources   Download

The Requires

 

The Development Requires

by Tauan Lemos

09/03 2018

dev-1-paginated-query

dev-1-paginated-query

Client to make graphql requests

  Sources   Download

The Requires

 

The Development Requires

by Tauan Lemos

15/02 2018

1.0

1.0.0.0

Client to make graphql requests

  Sources   Download

The Requires

 

The Development Requires

by Tauan Lemos