Add User sdl and service

This commit is contained in:
Rob Cameron
2022-02-08 15:12:44 -08:00
parent 7a03d6f343
commit e2c60fde13
4 changed files with 141 additions and 0 deletions

View File

@@ -0,0 +1,40 @@
export const schema = gql`
type User {
id: Int!
name: String
email: String!
hashedPassword: String!
salt: String!
resetToken: String
resetTokenExpiresAt: DateTime
}
type Query {
users: [User!]! @requireAuth
user(id: Int!): User @requireAuth
}
input CreateUserInput {
name: String
email: String!
hashedPassword: String!
salt: String!
resetToken: String
resetTokenExpiresAt: DateTime
}
input UpdateUserInput {
name: String
email: String
hashedPassword: String
salt: String
resetToken: String
resetTokenExpiresAt: DateTime
}
type Mutation {
createUser(input: CreateUserInput!): User! @requireAuth
updateUser(id: Int!, input: UpdateUserInput!): User! @requireAuth
deleteUser(id: Int!): User! @requireAuth
}
`