2019-04-21 00:49:05 +00:00
|
|
|
# ===============================================
|
|
|
|
# ASSETS
|
|
|
|
# ===============================================
|
|
|
|
|
|
|
|
extend type Query {
|
|
|
|
assets: AssetQuery
|
|
|
|
}
|
|
|
|
|
|
|
|
extend type Mutation {
|
|
|
|
assets: AssetMutation
|
|
|
|
}
|
|
|
|
|
|
|
|
# -----------------------------------------------
|
|
|
|
# QUERIES
|
|
|
|
# -----------------------------------------------
|
|
|
|
|
|
|
|
type AssetQuery {
|
|
|
|
list(
|
|
|
|
root: String
|
2019-05-13 05:15:27 +00:00
|
|
|
kind: AssetKind
|
|
|
|
): [AssetItem] @auth(requires: ["manage:system", "read:assets"])
|
2019-04-21 00:49:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
# -----------------------------------------------
|
|
|
|
# MUTATIONS
|
|
|
|
# -----------------------------------------------
|
|
|
|
|
|
|
|
type AssetMutation {
|
|
|
|
upload(
|
|
|
|
data: Upload!
|
|
|
|
): DefaultResponse
|
|
|
|
}
|
|
|
|
|
|
|
|
# -----------------------------------------------
|
|
|
|
# TYPES
|
|
|
|
# -----------------------------------------------
|
|
|
|
|
|
|
|
type AssetItem {
|
|
|
|
id: Int!
|
2019-05-13 05:15:27 +00:00
|
|
|
filename: String!
|
|
|
|
ext: String!
|
|
|
|
kind: AssetKind!
|
|
|
|
mime: String!
|
|
|
|
fileSize: Int!
|
|
|
|
metadata: String
|
|
|
|
createdAt: Date!
|
|
|
|
updatedAt: Date!
|
|
|
|
folder: AssetFolder
|
|
|
|
author: User
|
|
|
|
}
|
|
|
|
|
|
|
|
type AssetFolder {
|
|
|
|
id: Int!
|
2019-04-21 00:49:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
enum AssetKind {
|
|
|
|
IMAGE
|
|
|
|
BINARY
|
2019-05-18 06:27:30 +00:00
|
|
|
ALL
|
2019-04-21 00:49:05 +00:00
|
|
|
}
|