\Osiset\BasicShopifyAPI\MiddlewareUpdateApiLimits

Update API limits for REST and GraphQL calls.

Summary

Methods
Properties
Constants
toResponse()
__construct()
__invoke()
No public properties found
No constants found
isRestResponse()
isGraphResponse()
updateGraphCosts()
updateRestLimits()
$api
N/A
No private methods found
No private properties found
N/A

Properties

$api

$api : \Osiset\BasicShopifyAPI\BasicShopifyAPI

The API instance.

Type

\Osiset\BasicShopifyAPI\BasicShopifyAPI

Methods

toResponse()

toResponse(\Psr\Http\Message\StreamInterface  $body) 

Parameters

\Psr\Http\Message\StreamInterface $body

__construct()

__construct(\Osiset\BasicShopifyAPI\BasicShopifyAPI  $api) : self

Setup.

Parameters

\Osiset\BasicShopifyAPI\BasicShopifyAPI $api

The API instance.

Returns

self

__invoke()

__invoke(callable  $handler) : callable

Run.

Parameters

callable $handler

Returns

callable

isRestResponse()

isRestResponse(\Psr\Http\Message\ResponseInterface  $response) : boolean

Check if this is a REST request by sniffing headers.

Parameters

\Psr\Http\Message\ResponseInterface $response

Returns

boolean

isGraphResponse()

isGraphResponse(\Psr\Http\Message\ResponseInterface  $response) : boolean

Check if this is a GraphQL request by sniffing headers.

Parameters

\Psr\Http\Message\ResponseInterface $response

Returns

boolean

updateGraphCosts()

updateGraphCosts(\Psr\Http\Message\ResponseInterface  $response) : void

Update the GraphQL costs.

Parameters

\Psr\Http\Message\ResponseInterface $response

updateRestLimits()

updateRestLimits(\Psr\Http\Message\ResponseInterface  $response) : void

Updates the REST API call limits from Shopify headers.

Parameters

\Psr\Http\Message\ResponseInterface $response