Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Graphql Client Php

Graphql Client Php Laravel Package

ciloe/graphql-client-php

Lightweight PHP GraphQL client with a basic bridge/client setup or quick factory creation. Supports simple queries, named queries with variables, and optional caching via Symfony Cache adapters. Configure host/URI/token and send requests easily.

View on GitHub
Deep Wiki
Context7

At a glance

Frequently asked questions about Graphql Client Php
Is this GraphQL client compatible with Laravel 10+?
The package was last updated in 2018 and lacks explicit Laravel 10+ compatibility testing. While it can integrate via Guzzle or Laravel’s HTTP client, test thoroughly or consider modern alternatives like **overblog/graphql-client** for active maintenance.
How do I integrate this client with Laravel’s HTTP facade?
Use Laravel’s built-in HTTP client (`Http::withOptions()`) to wrap the GraphQL client’s requests. Configure the client’s bridge to use Laravel’s Guzzle handler or PSR-18 client, then inject it into services via the container.
Does this support GraphQL subscriptions or real-time updates?
No, this client only handles HTTP-based GraphQL queries. For subscriptions, use WebSocket libraries like **reactphp/graphql-subscriptions** or Laravel-specific packages like **beberlei/graphql-laravel**.
Can I cache GraphQL responses in Laravel?
Yes, use Symfony’s cache adapters (e.g., `FilesystemAdapter`) with Laravel’s cache system. Wrap the client’s responses in `Cache::remember()` or leverage Laravel’s `Cache` facade for TTL-based caching.
What’s the best way to handle errors in production?
The client provides basic error handling, but for production, extend it with Laravel middleware (e.g., `RetryMiddleware`) or queue failed requests using `spatie/laravel-queueable-middleware` for resilience.
How do I type-hint GraphQL responses in PHP?
The client returns raw JSON responses. Use PHP’s `JsonSerializable` or create custom DTOs (e.g., with `spatie/data-transfer-object`) to enforce type safety when parsing responses.
Are there alternatives with better Laravel support?
Yes, consider **overblog/graphql-client** (modern, PSR-18 compliant) or **webonyx/graphql-php** (for serving GraphQL). For Laravel-specific wrappers, check **laravel-graphql** or **beberlei/graphql-laravel** for subscriptions.
How do I batch multiple GraphQL queries?
Use the client’s `batchQuery()` method (if available) or manually merge queries into a single request. For complex batching, integrate with Laravel’s `Http::macro()` to extend functionality.
Does this work with Laravel’s service container?
Yes, bind the client to Laravel’s IoC container via `bind()` in a service provider. Example: `$app->bind(GraphQLClient::class, fn() => new BasicClient($bridge, $parser));`
How do I test GraphQL queries in Laravel’s HTTP tests?
Use Laravel’s `Http::fake()` to mock responses or test real endpoints with `$this->getJson('/graphql', ['query' => '...'])`. For integration tests, inject the client into test services and assert responses.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
gmostafa/php-graphql-client
xeviant/paystack
snowsoft/faker
meditationsteps/blogetc
animalyoung/laravel-influxdb
onix-solutions/sms-telera
lonely-lights/prosetta
oxygen/data
oxygen/core
jengo/base
xiloryx/log-collector
a21ns1g4ts/filament-stripe
la-php/laravel-admin
artisan-build/community-prompts
vleroy/smart
ayles-software/laravel-australian-public-holidays
cboxdk/laravel-id-spatie
cboxdk/laravel-id-billing
cboxdk/laravel-id-billing-bridge
simple-as-fuck/php-performance-log