What's your biggest current challenge? Have your say in Community Polls along the right column.
Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Fatal error: Uncaught TypeError: Key material must be a string, resource, or OpenSSLAsymmetricKey

Fatal error: Uncaught TypeError: Key material must be a string, resource, or OpenSSLAsymmetricKey

Rich3
Tourist
7 1 0

Hi 

 

I am trying in vain to connect to the API using GraphQL as it seems other methods I use that do connect won't allow me to do an update to a product.

 

Here is my code

 

$headers = array(
"api_version" => "2024-07",
"X-Shopify-Access-Token" => $this->accessToken,
"Authorization" => "Bearer $this->accessToken"
);

$cookies = array();
$isOnline = true;

$session = \Shopify\Utils::loadCurrentSession(
$headers,
$cookies,
$isOnline
);

$client = new Shopify\Clients\Graphql(
$session->getShop(),
$session->getAccessToken()
);

which just returns this error

 

Fatal error: Uncaught TypeError: Key material must be a string, resource, or OpenSSLAsymmetricKey in /Users/xxxxxx/Sites/MCMS/vendor/firebase/php-jwt/src/Key.php:31

 

Really struggling, lots of posts on this all with conflicting information, the documentation does not explain what is required in the $headers array or the $cookies array

 

Replies 0 (0)