Add User sdl and service
This commit is contained in:
40
api/src/graphql/users.sdl.js
Normal file
40
api/src/graphql/users.sdl.js
Normal 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
|
||||
}
|
||||
`
|
||||
Reference in New Issue
Block a user