interface UserAccount {
    id: ID!
    name: String!
    description: String!
    roles: [Role!]!
    permissions: [Permission!]
}

input usersInput {
    slim: Boolean
}

type Query {
    """
    User account
    """
    user(id: ID!): User
    """
    User accounts
    """
    users(input: usersInput): [User!]!
}

input addUserInput {
    name: String!
    password: String!
    description: String
}

input deleteUserInput {
    name: String!
}

type Mutation {
    """
    Add a new user
    """
    addUser(input: addUserInput!): User
    """
    Delete a user
    """
    deleteUser(input: deleteUserInput!): User
}

type Subscription {
    user(id: ID!): User!
    users: [User]!
}

"""
A local user account
"""
type User implements UserAccount {
    id: ID!
    """
    A unique name for the user
    """
    name: String!
    description: String!
    roles: [Role!]!
    """
    If the account has a password set
    """
    password: Boolean
    permissions: [Permission!]
}
