wikijs-fork/server/graph/schemas/asset.graphql

69 lines
1.2 KiB
GraphQL
Raw Normal View History

# ===============================================
# ASSETS
# ===============================================
extend type Query {
assets: AssetQuery
}
extend type Mutation {
assets: AssetMutation
}
# -----------------------------------------------
# QUERIES
# -----------------------------------------------
type AssetQuery {
list(
2019-05-21 20:45:27 +00:00
folderId: Int!
kind: AssetKind!
): [AssetItem] @auth(requires: ["manage:system", "read:assets"])
2019-05-21 20:45:27 +00:00
folders(
parentFolderId: Int!
): [AssetFolder] @auth(requires: ["manage:system", "read:assets"])
}
# -----------------------------------------------
# MUTATIONS
# -----------------------------------------------
type AssetMutation {
2019-05-21 20:45:27 +00:00
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!
2019-05-21 20:45:27 +00:00
slug: String!
name: String
}
enum AssetKind {
IMAGE
BINARY
ALL
}