diff --git a/app/graphql/schema/types/users/me.graphql b/app/graphql/schema/types/users/me.graphql new file mode 100644 index 000000000..6268052ce --- /dev/null +++ b/app/graphql/schema/types/users/me.graphql @@ -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 +} \ No newline at end of file diff --git a/app/graphql/schema/types/users/user.graphql b/app/graphql/schema/types/users/user.graphql index 0b5f7b65e..1d9cd2505 100644 --- a/app/graphql/schema/types/users/user.graphql +++ b/app/graphql/schema/types/users/user.graphql @@ -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 } \ No newline at end of file