class HTTPProvider implements PersistedQueryMappingProvider (View source)

Class HTTPProvider

Traits

Configurable
Injectable

Properties

static private int $timeout

Timeout for the HTTP request

protected array $schemaToURL

Example: SilverStripe\Core\Injector\Injector: SilverStripe\GraphQL\PersistedQuery\PersistedQueryMappingProvider: class :SilverStripe\GraphQL\PersistedQuery\HTTPProvider: properties: schemaMapping: default: 'http://example.com/mapping.json'

Methods

__construct(HTTPClient $client = null)

HTTPProvider constructor.

array
getQueryMapping(string $schemaKey = 'default')

return a map from to

string
getByID(string $queryID, string $schemaKey = 'default')

return a query given an ID

mixed
setSchemaMapping(array $mapping)

No description

array
getSchemaMapping()

No description

$this
setClient(HTTPClient $client)

No description

getClient()

No description

Details

__construct(HTTPClient $client = null)

HTTPProvider constructor.

Parameters

HTTPClient $client

array getQueryMapping(string $schemaKey = 'default')

return a map from to

Parameters

string $schemaKey

Return Value

array

string getByID(string $queryID, string $schemaKey = 'default')

return a query given an ID

Parameters

string $queryID
string $schemaKey

Return Value

string

mixed setSchemaMapping(array $mapping)

Parameters

array $mapping

Return Value

mixed

array getSchemaMapping()

Return Value

array

$this setClient(HTTPClient $client)

Parameters

HTTPClient $client

Return Value

$this

HTTPClient getClient()

Return Value

HTTPClient