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

97 lines
1.8 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-01-30 14:28:14 +01:00
type Query {
2020-02-01 14:52:27 +01:00
"List of registered users, must be admin to call"
2020-01-31 23:30:34 +01:00
users: [User!]! @isAdmin
2020-02-01 14:52:27 +01:00
"Information about the currently logged in user"
2020-01-31 23:30:34 +01:00
myUser: User
2020-02-01 14:52:27 +01:00
"List of albums owned by the logged in user"
myAlbums: [Album]
"Get album by id, user must own the album or be admin"
album(id: ID): Album
"List of photos owned by the logged in user"
myPhotos: [Photo]
"Get photo by id, user must own the photo or be admin"
photo(id: ID!): Photo
2020-01-30 14:28:14 +01:00
}
type Mutation {
authorizeUser(username: String!, password: String!): AuthorizeResult!
2020-01-31 18:51:24 +01:00
registerUser(
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-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!
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 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]
}