Refactor uploads to allow querying
Upload structure changed:
mutation uploadIcon(contextId: String!, upload: UploadInput!) {
id
url
mediaType
uploader {
id
}
# Local content
upload {
path
size
}
# Remote content
mirror {
url
}
}
You can pass as UploadInput!
either a path
or a url
. To query the upload on a resource for example:
query {
resource(resourceId: "ID") {
# replaces previous URL field
content {
url
mediaType
}
icon {
url
mediaType
}
}
}
Things still TODO:
-
Throw error if path AND url are set -
Handle extensions for remote files -
Update User/Community/Collection/Resource tests
Edited by Antonis Kalou