This package is an SDK for the GraphQL API.
The SDK on GitHub
Minimal PHP version: ^8.2
Requires GuzzleHttp ^7.7.0
For Laravel projects we recommend using the Laravel providers for REST or GraphQL.
You can install the SDK as a composer package.
composer require preprio/php-graphql-sdk
Let's start with getting some content items from your Prepr Environment.
<?php
use Preprio\Prepr;
$apiRequest = new Prepr('{ENDPOINT_URL}');
$apiRequest
->headers([
])
->query('fileurl')
->variables([
])
->request();
print_r($apiRequest->getResponse());
<?php
use Preprio\Prepr;
$apiRequest = new Prepr('{ENDPOINT_URL}');
$apiRequest
->headers([
])
->rawQuery('raw-query')
->variables([
])
->request();
print_r($apiRequest->getResponse());
With $apiRequest->getRawResponse()
you can get the raw response from the Prepr API.