On an IMAGE media resource I am successful with staging an upload, curl upload an image and get the url of newly uploaded via:
$graphqlstring = '{
files (first: 1, query:"filename:'.$arrMedia[0].'") {
edges {
node {
... on MediaImage {
image {
id
url
altText
height
width
}
}
}
}
}
}
';
I get ID and URL in the response which is great.
On an VIDEO resource I am having problems. I am again successful with staging an upload, curl upload the VIDEO but I cannot get the url via (from https://shopify.dev/api/admin-graphql/2022-10/queries/files)
$graphqlstring = '{
files (first: 1, query:"filename:'.$arrMedia[0].'") {
edges {
node {
... on Video {
id
duration
preview {
status
image {
id
width
height
url
}
}
originalSource {
url
width
height
format
mimeType
}
sources {
url
width
height
format
mimeType
}
}
}
}
}
}
';
I had to omit “originalFileSize” from the documentation because that threw an error (not available).
I only get this result still missing the url:
[data] => Array
(
[files] => Array
(
[edges] => Array
(
[0] => Array
(
[node] => Array
(
[id] => gid://shopify/Video/28012370f1795
[duration] =>
[preview] => Array
(
[status] => UPLOADED
[image] =>
)
[originalSource] =>
[sources] => Array
(
)
)
)
)
)
)
Any hints how to get the URL, or how to proceed from here?
Thank you.