mirror of
https://git.vectorsigma.ru/public/photoview.git
synced 2026-08-05 02:38:51 +00:00
82 lines
1.4 KiB
GraphQL
82 lines
1.4 KiB
GraphQL
enum Role {
|
|
Admin
|
|
User
|
|
}
|
|
|
|
type User @isAuthenticated {
|
|
id: ID!
|
|
username: String!
|
|
#: password: String
|
|
albums: [Album] @relation(name: "OWNS", direction: "OUT")
|
|
rootPath: String! @hasRole(roles: [Admin])
|
|
admin: Boolean
|
|
}
|
|
|
|
type Album {
|
|
id: ID!
|
|
title: String
|
|
photos: [Photo] @relation(name: "CONTAINS", direction: "OUT")
|
|
owner: User! @relation(name: "OWNS", direction: "IN")
|
|
path: String
|
|
}
|
|
|
|
type UnimportedAlbum {
|
|
id: ID!
|
|
relativePath: String
|
|
}
|
|
|
|
type PhotoURL {
|
|
path: String
|
|
width: Int
|
|
height: Int
|
|
}
|
|
|
|
type Photo {
|
|
id: ID!
|
|
title: String
|
|
original: PhotoURL @neo4j_ignore
|
|
thumbnail: PhotoURL @neo4j_ignore
|
|
album: Album! @relation(name: "CONTAINS", direction: "IN")
|
|
}
|
|
|
|
type SiteInfo {
|
|
signupEnabled: Boolean!
|
|
initialSetup: Boolean!
|
|
}
|
|
|
|
type AuthorizeResult {
|
|
success: Boolean!
|
|
status: String
|
|
token: String
|
|
}
|
|
|
|
type ScannerResult {
|
|
finished: Boolean!
|
|
error: Boolean!
|
|
errorMessage: String
|
|
progress: Float
|
|
}
|
|
|
|
type Subscription {
|
|
scannerStatusUpdate: ScannerResult
|
|
}
|
|
|
|
type Mutation {
|
|
authorizeUser(username: String!, password: String!): AuthorizeResult!
|
|
@neo4j_ignore
|
|
registerUser(username: String!, password: String!): AuthorizeResult!
|
|
@neo4j_ignore
|
|
|
|
scanAll: ScannerResult! @isAuthenticated @neo4j_ignore
|
|
}
|
|
|
|
type Query {
|
|
siteInfo: SiteInfo
|
|
|
|
myAlbums: [Album] @isAuthenticated
|
|
album(id: ID): Album @isAuthenticated
|
|
|
|
myPhotos: [Photo] @isAuthenticated
|
|
photo(id: ID): Photo @isAuthenticated
|
|
}
|