mirror of https://github.com/requarks/wiki
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
69 lines
1.2 KiB
69 lines
1.2 KiB
# ===============================================
|
|
# ASSETS
|
|
# ===============================================
|
|
|
|
extend type Query {
|
|
assets: AssetQuery
|
|
}
|
|
|
|
extend type Mutation {
|
|
assets: AssetMutation
|
|
}
|
|
|
|
# -----------------------------------------------
|
|
# QUERIES
|
|
# -----------------------------------------------
|
|
|
|
type AssetQuery {
|
|
list(
|
|
folderId: Int!
|
|
kind: AssetKind!
|
|
): [AssetItem] @auth(requires: ["manage:system", "read:assets"])
|
|
|
|
folders(
|
|
parentFolderId: Int!
|
|
): [AssetFolder] @auth(requires: ["manage:system", "read:assets"])
|
|
}
|
|
|
|
# -----------------------------------------------
|
|
# MUTATIONS
|
|
# -----------------------------------------------
|
|
|
|
type AssetMutation {
|
|
createFolder(
|
|
parentFolderId: Int!
|
|
slug: String!
|
|
name: String
|
|
): DefaultResponse @auth(requires: ["manage:system", "write:assets"])
|
|
}
|
|
|
|
# -----------------------------------------------
|
|
# TYPES
|
|
# -----------------------------------------------
|
|
|
|
type AssetItem {
|
|
id: Int!
|
|
filename: String!
|
|
ext: String!
|
|
kind: AssetKind!
|
|
mime: String!
|
|
fileSize: Int!
|
|
metadata: String
|
|
createdAt: Date!
|
|
updatedAt: Date!
|
|
folder: AssetFolder
|
|
author: User
|
|
}
|
|
|
|
type AssetFolder {
|
|
id: Int!
|
|
slug: String!
|
|
name: String
|
|
}
|
|
|
|
enum AssetKind {
|
|
IMAGE
|
|
BINARY
|
|
ALL
|
|
}
|