Unable to use mutation stagedUploadsCreate together with resourcetype VIDEO on Google Cloud

Unable to use mutation stagedUploadsCreate together with resourcetype VIDEO on Google Cloud

friendoftheroot
Shopify Partner
46 4 8

I have a problem with just the mutation stagedUploadsCreate($input: [StagedUploadInput!]!), which is the first step of uploading. It should provide a url and resourceUrl.

I have uploaded 10.000 images and 1000 videos via graphql mutations with the same code before.
Also tried several approaches and debug outputs and it all points to the following issue:

From time to time Shopify changes from AWS to Google Cloud and when that happens somehow I cannot get the stagedUploadsCreate to provide me the required data.


With Google Cloud and only when I try a resourcetype VIDEO, the parameters come back empty.

Works with resourcetype: FILE

 Request ID: bc8f992c-85f3-4cd6-9847-b719a185f5c6-1720650841

Does not work with resourcetype: VIDEO

 Request ID: 5d5d3ebc-d4ca-40d2-acf9-a1e470841efd-1720651119


Code Snippet used both times:

 

$filename = "__test234.mp4"; // Assume this is the file you want to upload
$filenamepath = "/path/".$filename;
$mimeType = mime_content_type($filenamepath);
$resourcetype = "VIDEO";
$fileSize = filesize($filenamepath);

$graphql_query = <<<GRAPHQL
mutation stagedUploadsCreate(\$input: [StagedUploadInput!]!) {
  stagedUploadsCreate(input: \$input) {
    stagedTargets {
      url
      resourceUrl
      parameters {
        name
        value
      }
    }
  }
}
GRAPHQL;

$variables = [
    "input" => [
        [
            "filename" => (string) $filename,
            "mimeType" => $mimeType,
            "httpMethod" => "POST",
            "resource" => $resourcetype,
            "fileSize" => (string) $fileSize
        ]
    ]
];

$post_data = json_encode([
    'query' => $graphql_query,
    'variables' => $variables
]);

 


What I send is the same in both instances, except resource

 

(
[filename] => __test234
[mimeType] => video/mp4
[httpMethod] => POST
[resource] => VIDEO
[fileSize] => 4240733 
)

 


But I get it back empty:

 

Array
(
 [url] =>
    [resourceUrl] =>
    [parameters] => Array
)

 

 

Replies 0 (0)