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

260 lines
3.6 KiB
GraphQL
Raw Normal View History

2017-08-07 01:05:10 +00:00
# ENUMS
enum FileType {
binary
image
}
enum RightRole {
read
write
manage
}
# TYPES
type KeyValuePair {
key: String!
value: String!
}
input KeyValuePairInput {
key: String!
value: String!
}
type DefaultResponse {
responseResult: ResponseStatus
}
type ResponseStatus {
succeeded: Boolean!
errorCode: Int!
slug: String!
message: String
}
type Comment {
2017-08-07 01:05:10 +00:00
id: Int!
2017-08-13 18:39:07 +00:00
createdAt: Date
updatedAt: Date
2017-08-07 01:05:10 +00:00
content: String
document: Document!
author: User!
}
type Document {
2017-08-07 01:05:10 +00:00
id: Int!
2017-08-13 18:39:07 +00:00
createdAt: Date
updatedAt: Date
2017-08-07 01:05:10 +00:00
path: String!
title: String!
subtitle: String
parentPath: String
parentTitle: String
isDirectory: Boolean!
isEntry: Boolean!
searchContent: String
comments: [Comment]
2017-08-07 01:05:10 +00:00
tags: [Tag]
}
type File {
2017-08-07 01:05:10 +00:00
id: Int!
2017-08-13 18:39:07 +00:00
createdAt: Date
updatedAt: Date
2017-08-07 01:05:10 +00:00
category: FileType!
mime: String!
extra: String
filename: String!
basename: String!
filesize: Int!
folder: Folder
}
type Folder {
2017-08-07 01:05:10 +00:00
id: Int!
2017-08-13 18:39:07 +00:00
createdAt: Date
updatedAt: Date
2017-08-07 01:05:10 +00:00
name: String!
files: [File]
2017-08-07 01:05:10 +00:00
}
type Right {
2017-08-07 01:05:10 +00:00
id: Int!
2017-08-13 18:39:07 +00:00
createdAt: Date
updatedAt: Date
2017-08-07 01:05:10 +00:00
path: String!
role: RightRole!
exact: Boolean!
allow: Boolean!
group: Group!
2017-08-07 01:05:10 +00:00
}
2017-09-30 02:32:43 +00:00
type SearchResult {
path: String
title: String
tags: [String]
}
type Setting {
2017-08-07 01:05:10 +00:00
id: Int!
2017-08-13 18:39:07 +00:00
createdAt: Date
updatedAt: Date
2017-08-07 01:05:10 +00:00
key: String!
config: String!
}
# Tags are attached to one or more documents
type Tag {
2017-08-07 01:05:10 +00:00
id: Int!
2017-08-13 18:39:07 +00:00
createdAt: Date
updatedAt: Date
2017-08-19 01:21:29 +00:00
key: String!
documents: [Document]
2017-08-07 01:05:10 +00:00
}
type Translation {
key: String!
value: String!
}
2017-08-19 01:21:29 +00:00
type OperationResult {
2018-01-10 01:41:53 +00:00
succeeded: Boolean!
2017-08-19 01:21:29 +00:00
message: String
2018-01-10 01:41:53 +00:00
data: String
}
# Query (Read)
2017-08-07 01:05:10 +00:00
type Query {
comments(id: Int): [Comment]
documents(id: Int, path: String): [Document]
files(id: Int): [File]
folders(id: Int, name: String): [Folder]
rights(id: Int): [Right]
2017-09-30 02:32:43 +00:00
search(q: String, tags: [String]): [SearchResult]
2017-08-07 01:05:10 +00:00
settings(key: String): [Setting]
tags(key: String): [Tag]
translations(locale: String!, namespace: String!): [Translation]
2017-08-07 01:05:10 +00:00
}
# Mutations (Create, Update, Delete)
type Mutation {
addRightToGroup(
groupId: Int!
path: String!
role: RightRole!
exact: Boolean!
allow: Boolean!
): Right
assignTagToDocument(
tagId: Int!
documentId: Int!
2017-08-19 01:21:29 +00:00
): OperationResult
createComment(
userId: Int!
documentId: Int!
content: String!
): Comment
2017-08-19 01:21:29 +00:00
createDocument(
path: String!
title: String!
subtitle: String
): Document
createFolder(
name: String!
): Folder
2017-08-19 01:21:29 +00:00
createTag(
name: String!
): Tag
2017-08-19 01:21:29 +00:00
deleteComment(
id: Int!
): OperationResult
2017-08-19 01:21:29 +00:00
deleteDocument(
id: Int!
): OperationResult
deleteFile(
id: Int!
): OperationResult
deleteFolder(
id: Int!
2017-08-19 01:21:29 +00:00
): OperationResult
deleteTag(
id: Int!
2017-08-19 01:21:29 +00:00
): OperationResult
modifyComment(
id: Int!
content: String!
): Document
2017-08-19 01:21:29 +00:00
modifyDocument(
id: Int!
title: String
subtitle: String
): Document
modifyRight(
id: Int!
path: String
role: RightRole
exact: Boolean
allow: Boolean
): Right
2017-08-19 01:21:29 +00:00
moveDocument(
id: Int!
path: String!
): OperationResult
moveFile(
id: Int!
folderId: Int!
): OperationResult
renameFile(
id: Int!
name: String!
): OperationResult
2017-08-19 01:21:29 +00:00
renameFolder(
id: Int!
name: String!
): OperationResult
renameTag(
id: Int!
key: String!
2017-08-19 01:21:29 +00:00
): OperationResult
removeTagFromDocument(
tagId: Int!
documentId: Int!
2017-08-19 01:21:29 +00:00
): OperationResult
removeRightFromGroup(
rightId: Int!
): OperationResult
setConfigEntry(
key: String!
value: String!
): OperationResult
uploadFile(
category: FileType!
filename: String!
): File
}