authorizer/server/graph/schema.graphqls
Lakhan Samani 0305a719db
feat: add support for magic link login (#65)
* feat: add support for magic link login

* update readme
2021-11-12 05:22:03 +05:30

142 lines
2.4 KiB
GraphQL

# GraphQL schema example
#
# https://gqlgen.com/getting-started/
scalar Int64
scalar Map
scalar Any
type Meta {
version: String!
isGoogleLoginEnabled: Boolean!
isFacebookLoginEnabled: Boolean!
isTwitterLoginEnabled: Boolean!
isGithubLoginEnabled: Boolean!
isEmailVerificationEnabled: Boolean!
isBasicAuthenticationEnabled: Boolean!
isMagicLoginEnabled: Boolean!
}
type User {
id: ID!
email: String!
signupMethod: String!
firstName: String
lastName: String
emailVerifiedAt: Int64
image: String
createdAt: Int64
updatedAt: Int64
roles: [String!]!
}
type VerificationRequest {
id: ID!
identifier: String
token: String
email: String
expires: Int64
createdAt: Int64
updatedAt: Int64
}
type Error {
message: String!
reason: String!
}
type AuthResponse {
message: String!
accessToken: String
accessTokenExpiresAt: Int64
user: User
}
type Response {
message: String!
}
input SignUpInput {
firstName: String
lastName: String
email: String!
password: String!
confirmPassword: String!
image: String
roles: [String!]
}
input LoginInput {
email: String!
password: String!
roles: [String!]
}
input VerifyEmailInput {
token: String!
}
input ResendVerifyEmailInput {
email: String!
}
input UpdateProfileInput {
oldPassword: String
newPassword: String
confirmNewPassword: String
firstName: String
lastName: String
image: String
email: String
# roles: [String]
}
input AdminUpdateUserInput {
id: ID!
email: String
firstName: String
lastName: String
image: String
roles: [String]
}
input ForgotPasswordInput {
email: String!
}
input ResetPasswordInput {
token: String!
password: String!
confirmPassword: String!
}
input DeleteUserInput {
email: String!
}
input MagicLoginInput {
email: String!
roles: [String!]
}
type Mutation {
signup(params: SignUpInput!): AuthResponse!
login(params: LoginInput!): AuthResponse!
magicLogin(params: MagicLoginInput!): Response!
logout: Response!
updateProfile(params: UpdateProfileInput!): Response!
adminUpdateUser(params: AdminUpdateUserInput!): User!
verifyEmail(params: VerifyEmailInput!): AuthResponse!
resendVerifyEmail(params: ResendVerifyEmailInput!): Response!
forgotPassword(params: ForgotPasswordInput!): Response!
resetPassword(params: ResetPasswordInput!): Response!
deleteUser(params: DeleteUserInput!): Response!
}
type Query {
meta: Meta!
users: [User!]!
token(roles: [String!]): AuthResponse
profile: User!
verificationRequests: [VerificationRequest!]!
}