Download the PHP package bright-alley/lighthouse-apollo without Composer
On this page you can find all versions of the php package bright-alley/lighthouse-apollo. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download bright-alley/lighthouse-apollo
More information about bright-alley/lighthouse-apollo
Files in bright-alley/lighthouse-apollo
Package lighthouse-apollo
Short Description Integration to upload information from Laravel Lighthouse to Apollo Studio.
License MIT
Informations about the package lighthouse-apollo
Laravel Lighthouse Apollo Integration
This library allows integrating your Lighthouse GraphQL project with Apollo Studio, sending tracing statistics and allowing you to send your schema to Apollo for breaking changes notifications.
Lighthouse requirements
This library is tested with Lighthouse 6.
For Lighthouse 4.x, use version 1.x
of this library.
For Lighthouse 5.x, use version 2.x
of this library.
Installation
First, install the Composer package:
composer require bright-alley/lighthouse-apollo
Next, publish the config file and adjust it as desired:
php artisan vendor:publish --provider="BrightAlley\LighthouseApollo\ServiceProvider"
The service provider for this package is automatically registered. If you have disabled
auto-discovery of service providers, make sure to add \BrightAlley\LighthouseApollo\ServiceProvider
to your service providers. Lighthouse's TracingServiceProvider is automatically registered.
By default, the tracing results are stripped from the actual GraphQL response when not
in debug mode.
When using the redis or database send tracing mode (highly recommended for production
usage), make sure to add the lighthouse-apollo:publish-tracing
artisan command to your
console kernel's schedule, so it runs frequently to send queued trace results to Apollo.
You can adjust the schedule to run more or less often based on your traffic volume.
Client tracing
You can gather information about which clients are calling your GraphQL API. If you have
control over the clients, add the x-apollo-client-name
and x-apollo-client-version
headers to your GraphQL requests, and they will be gathered and sent to Apollo Studio.
If you need more control over client tracing on the server side, you can create your own
custom logic by implementing the BrightAlley\LighthouseApollo\Contracts\ClientInformationExtractor
interface, and binding your own implementation to the app container in your service
provider, like so:
Development
Protobuf is used for sending traces to Apollo Studio. To generate new stubs, use the following command:
protoc -I resources --php_out=generated/ resources/*.proto
All versions of lighthouse-apollo with dependencies
ext-curl Version *
ext-json Version *
ext-zlib Version *
czproject/git-php Version ^4.0
google/protobuf Version ^v3.13.0.1
illuminate/redis Version ^9.0 || ^10.0
illuminate/support Version ^9.0 || ^10.0
nuwave/lighthouse Version ^6.0