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

150 lines
3.0 KiB
GraphQL
Raw Normal View History

2020-01-31 23:30:34 +01:00
directive @isAdmin on FIELD_DEFINITION
2020-01-31 18:51:24 +01:00
scalar Time
2020-02-09 15:26:59 +01:00
enum OrderDirection {
ASC
DESC
}
input Filter {
order_by: String
order_direction: OrderDirection
limit: Int
offset: Int
}
2020-01-30 14:28:14 +01:00
type Query {
2020-02-09 12:53:21 +01:00
siteInfo: SiteInfo!
2020-02-05 16:49:51 +01:00
2020-02-01 14:52:27 +01:00
"List of registered users, must be admin to call"
2020-02-09 15:26:59 +01:00
users(filter: Filter): [User!]! @isAdmin
2020-02-01 14:52:27 +01:00
"Information about the currently logged in user"
2020-02-09 12:53:21 +01:00
myUser: User!
2020-02-01 14:52:27 +01:00
"List of albums owned by the logged in user"
2020-02-09 15:26:59 +01:00
myAlbums(filter: Filter): [Album!]!
2020-02-01 14:52:27 +01:00
"Get album by id, user must own the album or be admin"
2020-02-09 12:53:21 +01:00
album(id: ID): Album!
2020-02-01 14:52:27 +01:00
"List of photos owned by the logged in user"
2020-02-09 15:26:59 +01:00
myPhotos(filter: Filter): [Photo!]!
2020-02-01 14:52:27 +01:00
"Get photo by id, user must own the photo or be admin"
2020-02-09 12:53:21 +01:00
photo(id: ID!): Photo!
2020-01-30 14:28:14 +01:00
}
type Mutation {
authorizeUser(username: String!, password: String!): AuthorizeResult!
2020-02-05 16:49:51 +01:00
"Registers a new user, must be admin to call"
2020-01-31 18:51:24 +01:00
registerUser(
username: String!
password: String!
rootPath: String!
2020-02-09 12:53:21 +01:00
): AuthorizeResult!
2020-02-05 16:49:51 +01:00
"Registers the initial user, can only be called if initialSetup from SiteInfo is true"
initialSetupWizard(
username: String!
password: String!
rootPath: String!
): AuthorizeResult
2020-02-01 17:58:45 +01:00
"Scan all users for new photos"
scanAll: ScannerResult!
"Scan a single user for new photos"
scanUser(userId: ID!): ScannerResult!
2020-01-30 14:28:14 +01:00
}
type AuthorizeResult {
success: Boolean!
status: String!
token: String
}
2020-02-01 17:58:45 +01:00
type ScannerResult {
finished: Boolean!
success: Boolean!
progress: Float
message: String
}
2020-02-05 16:49:51 +01:00
"General public information about the site"
type SiteInfo {
initialSetup: Boolean!
}
2020-01-30 14:28:14 +01:00
type User {
id: ID!
username: String!
#albums: [Album]
2020-02-01 14:52:27 +01:00
"Local filepath for the user's photos"
2020-01-31 23:30:34 +01:00
rootPath: String! @isAdmin
2020-01-30 14:28:14 +01:00
admin: Boolean!
#shareTokens: [ShareToken]
}
2020-02-01 14:52:27 +01:00
type Album {
id: ID!
2020-02-09 12:53:21 +01:00
title: String!
2020-02-09 15:26:59 +01:00
photos(filter: Filter): [Photo!]!
2020-02-09 16:16:41 +01:00
subAlbums(filter: Filter): [Album!]!
2020-02-01 14:52:27 +01:00
parentAlbum: Album
owner: User!
2020-02-09 12:53:21 +01:00
path: String!
2020-02-09 16:16:41 +01:00
thumbnail: Photo
2020-02-01 14:52:27 +01:00
# shares: [ShareToken]
}
type PhotoURL {
"URL for previewing the image"
2020-02-09 12:53:21 +01:00
url: String!
2020-02-01 14:52:27 +01:00
"Width of the image in pixels"
2020-02-09 12:53:21 +01:00
width: Int!
2020-02-01 14:52:27 +01:00
"Height of the image in pixels"
2020-02-09 12:53:21 +01:00
height: Int!
2020-02-01 14:52:27 +01:00
}
type Photo {
id: ID!
2020-02-09 12:53:21 +01:00
title: String!
2020-02-01 14:52:27 +01:00
"Local filepath for the photo"
2020-02-09 12:53:21 +01:00
path: String!
2020-02-01 14:52:27 +01:00
"URL to display the photo in full resolution"
2020-02-09 12:53:21 +01:00
original: PhotoURL!
2020-02-01 14:52:27 +01:00
"URL to display the photo in a smaller resolution"
2020-02-09 12:53:21 +01:00
thumbnail: PhotoURL!
highRes: PhotoURL!
2020-02-01 14:52:27 +01:00
"The album that holds the photo"
album: Album!
2020-02-02 00:29:42 +01:00
exif: PhotoEXIF
2020-02-01 14:52:27 +01:00
# shares: [ShareToken]
# downloads: [PhotoDownload]
}
2020-02-02 00:29:42 +01:00
"EXIF metadata from the camera"
type PhotoEXIF {
photo: Photo
"The model name of the camera"
camera: String
"The maker of the camera"
maker: String
"The name of the lens"
lens: String
dateShot: Time
"The formatted filesize of the image"
fileSize: String
"The exposure time of the image"
exposure: String
"The aperature stops of the image"
aperture: Float
"The ISO setting of the image"
iso: Int
"The focal length of the lens, when the image was taken"
focalLength: String
"A formatted description of the flash settings, when the image was taken"
flash: String
}