Skip to content

Instantly share code, notes, and snippets.

View rasikag's full-sized avatar
🎯
Focusing

Rasika Gayan Gunarathna rasikag

🎯
Focusing
View GitHub Profile
fragment RegularUserResponse on UserResponse {
errors {
...RegularError
}
user {
...RegularUser
}
}
fragment RegularError on FieldError {
id
username
}
mutation ChangePassword($token: String!, $newPassword: String!) {
changePassword(token: $token, newPassword: $newPassword) {
errors {
...RegularError
}
user {
...RegularUser
}
}
}
@Mutation(() => UserResponse)
async changePassword(
@Arg("token") token: string,
@Arg("newPassword") newPassword: string,
@Ctx() { em, redis, req }: RedditDbContext
): Promise<UserResponse> {
// first validate the password
if (newPassword.length <= 2) {
return {
errors: [
return (
<Wrapper variant="small">
<Formik
initialValues={{ newPassword: "" }}
onSubmit={async (values, { setErrors }) => {}}
>
{({ isSubmitting }) => (
<Form>
<Box mt={4}>
<InputField
ChangePassword.getInitialProps = ({query}) => {
return {
token: query.token as string
}
}
import { NextPage } from "next";
import React from "react";
const ChangePassword: NextPage<{ token: string }> = ({ token }) => {
return <div></div>;
};
mutation {
forgotPassword(email:"rasika@rasikag.com")
}
public class Tag
{
public int Id { get; set; }
public string Text { get; set; }
public ICollection<PostTag> PostTags { get; set; }
}
public class Post
{
public int Id { get; set; }
public string Name { get; set; }
public ICollection<PostTag> PostTags { get; set; }
}