1
Fork 0
photoview/api/graphql/schema-reference.graphql

162 lines
2.8 KiB
GraphQL
Raw Normal View History

2020-01-30 14:28:14 +01:00
scalar Time
enum Role {
admin
user
}
type User {
id: ID!
username: String!
albums: [Album]
# Local filepath for the user's photos
rootPath: String!
admin: Boolean
shareTokens: [ShareToken]
}
type Album {
id: ID!
title: String
photos: [Photo]
subAlbums: [Album]
parentAlbum: Album
owner: User!
path: String
shares: [ShareToken]
}
type PhotoURL {
# URL for previewing the image
url: String
# Width of the image in pixels
width: Int
# Height of the image in pixels
height: Int
}
type PhotoDownload {
title: String
url: String
}
type PhotoEXIF {
photo: Photo
camera: String
maker: String
lens: String
dateShot: Time
fileSize: String
exposure: String
aperture: Float
iso: Int
focalLength: String
flash: String
}
type Photo {
id: ID!
title: String
# Local filepath for the photo
path: String
# URL to display the photo in full resolution
original: PhotoURL
# URL to display the photo in a smaller resolution
thumbnail: PhotoURL
# The album that holds the photo
album: Album!
exif: PhotoEXIF
shares: [ShareToken]
downloads: [PhotoDownload]
}
type ShareToken {
token: ID!
2020-02-09 21:25:33 +01:00
owner: User!
2020-01-30 14:28:14 +01:00
# Optional expire date
2020-02-09 21:25:33 +01:00
expire: Time!
2020-01-30 14:28:14 +01:00
# Optional password
# password: String
album: Album
photo: Photo
}
type SiteInfo {
initialSetup: Boolean!
}
type AuthorizeResult {
success: Boolean!
status: String
token: String
}
type ScannerResult {
finished: Boolean!
success: Boolean!
progress: Float
message: String
}
type Result {
success: Boolean!
errorMessage: String
}
type Subscription {
scannerStatusUpdate: ScannerResult
}
type Mutation {
authorizeUser(username: String!, password: String!): AuthorizeResult!
registerUser(
username: String!
password: String!
rootPath: String!
): AuthorizeResult!
shareAlbum(albumId: ID!, expire: Time, password: String): ShareToken
sharePhoto(photoId: ID!, expire: Time, password: String): ShareToken
deleteShareToken(token: ID!): ShareToken
setAdmin(userId: ID!, admin: Boolean!): Result!
scanAll: ScannerResult!
scanUser(userId: ID!): ScannerResult!
initialSetupWizard(
username: String!
password: String!
rootPath: String!
): AuthorizeResult
updateUser(id: ID!, username: String, rootPath: String, admin: Boolean): User
createUser(id: ID, username: String, rootPath: String, admin: Boolean): User
deleteUser(id: ID!): User
changeUserPassword(id: ID!, newPassword: String!): Result
}
type Query {
siteInfo: SiteInfo
myUser: User
user: [User]
myAlbums: [Album]
album(id: ID): Album
myPhotos: [Photo]
photo(id: ID!): Photo
shareToken(token: ID!): ShareToken
albumShares(id: ID!, password: String): [ShareToken]
photoShares(id: ID!, password: String): [ShareToken]
}