Search by

coac-factory / api-client-php

josep.pujol

API COAC GraphQL client

Package info

bitbucket.org/coac-factory/coac-api-client-php

pkg:composer/coac-factory/api-client-php

Statistics

Installs: 3

Dependents: 0

Suggesters: 0

v1.0.1 2026-07-24 10:54 UTC

This package is auto-updated.

Last update: 2026-08-24 11:12:43 UTC


README

Framework-agnostic GraphQL client for PHP 8+ with JWT authentication (username/password -> Bearer token).

Features

  • Composer installable library
  • JWT authentication with token caching
  • Retry on 401 (token refresh)
  • Framework-agnostic (Symfony, WordPress, CLI, etc.)

Installation

composer require coac-factory/api-client-php

Usage

use CoacFactory\GraphQLClient\Config\ClientConfig;
use CoacFactory\GraphQLClient\Auth\JwtTokenProvider;
use CoacFactory\GraphQLClient\Http\GraphQLClient;

$config = new ClientConfig(
    'https://api.example.com/graphql',
    'user',
    'password',
);
$client = new GraphQLClient($config);

$result = $client->query('
    query {
        items { id name }
    }
');