Hi all!
I’m using the fileCreate mutation to upload an image, after that I’m expected to get an URL back for the image, but it returns null every time. Is this normal or am I misunderstanding something?
The staging and upload process works fine, its just the return that’s not what I’m expecting.
const response = await admin.graphql(
`
mutation fileCreate($files: [FileCreateInput!]!) {
fileCreate(files: $files) {
files {
alt
... on MediaImage {
id
mediaContentType
mimeType
status
preview {
image {
url
}
}
image {
src
url(transform: {})
id
}
}
... on Video {
id
filename
preview {
image {
url
}
}
}
}
}
}`,
{
variables: {
files: {
contentType: type,
originalSource: resourceUrl,
},
},
}
);