mirror of
https://git.vectorsigma.ru/public/photoview.git
synced 2026-08-03 22:49:08 +00:00
54 lines
1.0 KiB
GraphQL
54 lines
1.0 KiB
GraphQL
enum Role {
|
|
Admin
|
|
User
|
|
}
|
|
|
|
type User @isAuthenticated {
|
|
id: ID!
|
|
username: String!
|
|
albums: [Album] @relation(name: "OWNS", direction: "OUT")
|
|
rootPath: String! @hasRole(roles: [Admin])
|
|
admin: Boolean
|
|
}
|
|
|
|
type Album @isAuthenticated {
|
|
id: ID!
|
|
title: String
|
|
photos: [Photo] @relation(name: "CONTAINS", direction: "OUT")
|
|
owner: User! @ relation(name: "OWNS", direction: "IN")
|
|
}
|
|
|
|
type Photo @isAuthenticated {
|
|
id: ID!
|
|
title: String
|
|
path: String!
|
|
album: Album! @relation(name: "CONTAINS", direction: "IN")
|
|
}
|
|
|
|
type SiteInfo {
|
|
signupEnabled: Boolean!
|
|
firstSignup: Boolean!
|
|
}
|
|
|
|
type AuthorizeResult {
|
|
success: Boolean!
|
|
status: String
|
|
token: String
|
|
}
|
|
|
|
type Mutation {
|
|
authorizeUser(username: String!, password: String!): AuthorizeResult!
|
|
registerUser(username: String!, password: String!): AuthorizeResult!
|
|
}
|
|
|
|
type Query {
|
|
siteInfo: SiteInfo
|
|
}
|
|
|
|
# type Query {
|
|
# usersBySubstring(substring: String): [User]
|
|
# @cypher(
|
|
# statement: "MATCH (u:User) WHERE u.name CONTAINS $substring RETURN u"
|
|
# )
|
|
# }
|