Download the PHP package raphaelcangucu/gql-client without Composer
On this page you can find all versions of the php package raphaelcangucu/gql-client. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download raphaelcangucu/gql-client
More information about raphaelcangucu/gql-client
Files in raphaelcangucu/gql-client
Package gql-client
Short Description Graphql Client for Laravel
License ISC
Homepage https://github.com/bendeckdavid/graphql-laravel-client#readme
Informations about the package gql-client
GraphQL Laravel Client
A minimal GraphQL client for Laravel applications. This package is a continuation of the original work by David Gutierrez (BendeckDavid), who has discontinued this project. We've updated it with the latest dependencies, comprehensive testing, and continued maintenance under the new namespace.
Credits
Original Author: David Gutierrez @bendeckdavid
This package is based on the original bendeckdavid/graphql-client package. All core functionality and design patterns are credited to the original author. This fork continues development with bug fixes, updates, and improvements.
Requirements
- PHP ^8.0
- Laravel ^8.0|^9.0|^10.0|^11.0|^12.0
- Composer 2+
Installation
Install Package (Composer 2+)
Usage
Enviroment variable
Authentication
We provide a minimal authentication integration by appending the Authorization header to the request client. You can pass the credentials using an env variable.
You can also pass auth credentials at runtime using withToken($credentials) method.
'Authorization' header and 'Bearer' Schema are used by default. You can override the default behaviour by defining following variables in your .env file.
Usage/Examples
Import GraphQL Client Facades
Basic use
Mutation request:
You can access "query" or "mutation" as a shortcut if you are not passing variables, if is not the case you must use the "raw" attribute:
The variables or payload to the GraphQL request can also be passed using magic methods like:
If you want to address te request to another endpoint, you can do :
Headers
You can include a header to the request by using the attribute "header" or add multiple headers by "withHeaders":
Context
Add additional context to the request
Testing
This package comes with comprehensive test coverage. Run tests using:
For coverage reports:
Configuration Publishing
Publish the configuration file to customize authentication and endpoint settings:
What's New in This Fork
- Updated to support PHP 8.0+ and Laravel 8-12
- Laravel 12 compatibility added in version 0.2.0
- Comprehensive test suite with 40+ tests
- Updated dependencies and security improvements
- Fixed deprecated method names (
mutator→mutation) - Improved error handling and documentation
- Full namespace migration for modern Laravel applications
Original Author & Contributors
Original Author: David Gutierrez @bendeckdavid
Original Top Contributors:
- Ehsan Quddusi @ehsanquddusi
Original Contributors:
Current Maintainer
- Raphael Cangucu @raphaelcangucu
License
This project maintains the same license as the original package.
All versions of gql-client with dependencies
illuminate/support Version ^8.0|^9.0|^10.0|^11.0|^12.0
illuminate/config Version ^8.0|^9.0|^10.0|^11.0|^12.0