update user schema and add me

Signed-off-by: Alexis Tyler <xo@wvvw.me>
This commit is contained in:
Alexis Tyler
2019-08-02 14:42:36 +09:30
parent 4e13ab9f60
commit d634c2d4d1
2 changed files with 33 additions and 5 deletions

View File

@@ -0,0 +1,16 @@
type Query {
"""Current user account"""
me: Me @func(module: "get-me")
}
# type Mutation {
# }
"""The current user"""
type Me implements UserAccount {
id: String!
name: String!
description: String!
role: String!
permissions: JSON
}

View File

@@ -1,10 +1,15 @@
interface UserAccount {
id: String!
name: String!
description: String!
role: String!
}
input usersInput {
slim: Boolean
}
type Query {
"""Current user"""
me: User
"""User account"""
user(id: String!): User @func(module: "users/id/get-user")
"""User accounts"""
@@ -17,17 +22,24 @@ input addUserInput {
description: String
}
input deleteUserInput {
name: String!
}
type Mutation {
"""Add a new user"""
addUser(input: addUserInput!): User @func(module: "add-user")
"""Delete a user"""
deleteUser(input: deleteUserInput!): User @func(module: "users/id/delete-user")
}
"""A local user account"""
type User {
type User implements UserAccount {
id: String!
"""A unique name for the user"""
name: String
description: String
name: String!
description: String!
role: String!
"""If the account has a password set"""
password: Boolean
}