2021-07-08 12:15:19 +00:00
|
|
|
# GraphQL schema example
|
|
|
|
#
|
|
|
|
# https://gqlgen.com/getting-started/
|
2021-07-12 18:22:16 +00:00
|
|
|
scalar Int64
|
2021-07-08 12:15:19 +00:00
|
|
|
|
2021-07-28 07:55:52 +00:00
|
|
|
type Meta {
|
2021-08-06 13:47:52 +00:00
|
|
|
version: String!
|
|
|
|
isGoogleLoginEnabled: Boolean!
|
|
|
|
isFacebookLoginEnabled: Boolean!
|
|
|
|
isTwitterLoginEnabled: Boolean!
|
|
|
|
isGithubLoginEnabled: Boolean!
|
|
|
|
isEmailVerificationEnabled: Boolean!
|
|
|
|
isBasicAuthenticationEnabled: Boolean!
|
2021-07-28 07:55:52 +00:00
|
|
|
}
|
|
|
|
|
2021-07-12 18:22:16 +00:00
|
|
|
type User {
|
2021-08-06 13:47:52 +00:00
|
|
|
id: ID!
|
|
|
|
email: String!
|
|
|
|
signupMethod: String!
|
|
|
|
firstName: String
|
|
|
|
lastName: String
|
|
|
|
emailVerifiedAt: Int64
|
|
|
|
image: String
|
|
|
|
createdAt: Int64
|
|
|
|
updatedAt: Int64
|
2021-07-08 12:15:19 +00:00
|
|
|
}
|
|
|
|
|
2021-07-12 18:22:16 +00:00
|
|
|
type VerificationRequest {
|
2021-08-06 13:47:52 +00:00
|
|
|
id: ID!
|
|
|
|
identifier: String
|
|
|
|
token: String
|
|
|
|
email: String
|
|
|
|
expires: Int64
|
|
|
|
createdAt: Int64
|
|
|
|
updatedAt: Int64
|
2021-07-12 18:22:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type Error {
|
2021-08-06 13:47:52 +00:00
|
|
|
message: String!
|
|
|
|
reason: String!
|
2021-07-12 18:22:16 +00:00
|
|
|
}
|
|
|
|
|
2021-07-28 10:13:08 +00:00
|
|
|
type AuthResponse {
|
2021-08-06 13:47:52 +00:00
|
|
|
message: String!
|
|
|
|
accessToken: String
|
|
|
|
accessTokenExpiresAt: Int64
|
|
|
|
user: User
|
2021-07-12 18:22:16 +00:00
|
|
|
}
|
|
|
|
|
2021-07-15 09:43:00 +00:00
|
|
|
type Response {
|
2021-08-06 13:47:52 +00:00
|
|
|
message: String!
|
2021-07-15 09:43:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
input SignUpInput {
|
2021-08-06 13:47:52 +00:00
|
|
|
firstName: String
|
|
|
|
lastName: String
|
|
|
|
email: String!
|
|
|
|
password: String!
|
|
|
|
confirmPassword: String!
|
|
|
|
image: String
|
2021-07-12 18:22:16 +00:00
|
|
|
}
|
|
|
|
|
2021-07-14 18:43:19 +00:00
|
|
|
input LoginInput {
|
2021-08-06 13:47:52 +00:00
|
|
|
email: String!
|
|
|
|
password: String!
|
2021-07-08 12:15:19 +00:00
|
|
|
}
|
|
|
|
|
2021-07-18 03:55:20 +00:00
|
|
|
input VerifyEmailInput {
|
2021-08-06 13:47:52 +00:00
|
|
|
token: String!
|
2021-07-13 20:06:11 +00:00
|
|
|
}
|
|
|
|
|
2021-07-18 07:26:17 +00:00
|
|
|
input ResendVerifyEmailInput {
|
2021-08-06 13:47:52 +00:00
|
|
|
email: String!
|
2021-07-18 07:26:17 +00:00
|
|
|
}
|
|
|
|
|
2021-07-18 03:55:20 +00:00
|
|
|
input UpdateProfileInput {
|
2021-08-06 13:47:52 +00:00
|
|
|
oldPassword: String
|
|
|
|
newPassword: String
|
|
|
|
confirmNewPassword: String
|
|
|
|
firstName: String
|
|
|
|
lastName: String
|
|
|
|
image: String
|
|
|
|
email: String
|
2021-07-18 03:55:20 +00:00
|
|
|
}
|
|
|
|
|
2021-07-21 08:06:26 +00:00
|
|
|
input ForgotPasswordInput {
|
2021-08-06 13:47:52 +00:00
|
|
|
email: String!
|
2021-07-18 09:56:29 +00:00
|
|
|
}
|
|
|
|
|
2021-08-07 08:41:26 +00:00
|
|
|
input ResetPasswordInput {
|
2021-08-06 13:47:52 +00:00
|
|
|
token: String!
|
|
|
|
password: String!
|
|
|
|
confirmPassword: String!
|
|
|
|
}
|
|
|
|
|
|
|
|
input DeleteUserInput {
|
|
|
|
email: String!
|
2021-07-18 09:56:29 +00:00
|
|
|
}
|
|
|
|
|
2021-07-08 12:15:19 +00:00
|
|
|
type Mutation {
|
2021-08-06 13:47:52 +00:00
|
|
|
signup(params: SignUpInput!): AuthResponse!
|
|
|
|
login(params: LoginInput!): AuthResponse!
|
|
|
|
logout: Response!
|
|
|
|
updateProfile(params: UpdateProfileInput!): Response!
|
|
|
|
verifyEmail(params: VerifyEmailInput!): AuthResponse!
|
|
|
|
resendVerifyEmail(params: ResendVerifyEmailInput!): Response!
|
|
|
|
forgotPassword(params: ForgotPasswordInput!): Response!
|
2021-08-07 08:41:26 +00:00
|
|
|
resetPassword(params: ResetPasswordInput!): Response!
|
2021-08-06 13:47:52 +00:00
|
|
|
deleteUser(params: DeleteUserInput!): Response!
|
2021-07-14 18:43:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type Query {
|
2021-08-06 13:47:52 +00:00
|
|
|
meta: Meta!
|
|
|
|
users: [User!]!
|
|
|
|
token: AuthResponse
|
|
|
|
profile: User!
|
|
|
|
verificationRequests: [VerificationRequest!]!
|
2021-07-12 18:22:16 +00:00
|
|
|
}
|