Basic transaction system
This commit is contained in:
48
api/src/graphql/users.sdl.ts
Normal file
48
api/src/graphql/users.sdl.ts
Normal file
@@ -0,0 +1,48 @@
|
||||
export const schema = gql`
|
||||
type User {
|
||||
id: Int!
|
||||
firstName: String!
|
||||
lastName: String!
|
||||
email: String!
|
||||
hashedPassword: String!
|
||||
salt: String!
|
||||
resetToken: String
|
||||
resetTokenExpiresAt: DateTime
|
||||
roles: String!
|
||||
transactions: [Transaction]!
|
||||
}
|
||||
|
||||
type Query {
|
||||
users: [User!]! @requireAuth(roles: "admin")
|
||||
user(id: Int!): User @requireAuth(roles: "admin")
|
||||
}
|
||||
|
||||
input CreateUserInput {
|
||||
firstName: String!
|
||||
lastName: String!
|
||||
email: String!
|
||||
hashedPassword: String!
|
||||
salt: String!
|
||||
resetToken: String
|
||||
resetTokenExpiresAt: DateTime
|
||||
roles: String!
|
||||
}
|
||||
|
||||
input UpdateUserInput {
|
||||
firstName: String
|
||||
lastName: String
|
||||
email: String
|
||||
hashedPassword: String
|
||||
salt: String
|
||||
resetToken: String
|
||||
resetTokenExpiresAt: DateTime
|
||||
roles: String
|
||||
}
|
||||
|
||||
type Mutation {
|
||||
createUser(input: CreateUserInput!): User! @requireAuth(roles: "admin")
|
||||
updateUser(id: Int!, input: UpdateUserInput!): User!
|
||||
@requireAuth(roles: "admin")
|
||||
deleteUser(id: Int!): User! @requireAuth(roles: "admin")
|
||||
}
|
||||
`
|
||||
Reference in New Issue
Block a user