Files
photoview/api/src/schema.graphql
2019-07-07 23:53:07 +02:00

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"
# )
# }