fix: resolve GraphQL request hang in Fastify integration
- Pass FastifyRequest/FastifyReply directly to yoga.handleNodeRequestAndResponse per the official graphql-yoga Fastify integration docs. Yoga v5 uses req.body (already parsed by Fastify) when available, avoiding the dead raw stream issue. - Add proper TypeScript generics for server context including db and redis - Wrap sendVerification/sendPasswordReset in try/catch so missing SMTP does not crash register/requestPasswordReset mutations - Fix migrate.ts path resolution to work with both tsx (src/) and compiled (dist/) - Expose postgres:5432 and redis:6379 ports in compose.yml for local dev Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -129,7 +129,11 @@ builder.mutationField("register", (t) =>
|
||||
email_verified: false,
|
||||
});
|
||||
|
||||
await sendVerification(args.email, verifyToken);
|
||||
try {
|
||||
await sendVerification(args.email, verifyToken);
|
||||
} catch (e) {
|
||||
console.warn("Failed to send verification email:", (e as Error).message);
|
||||
}
|
||||
return true;
|
||||
},
|
||||
}),
|
||||
@@ -184,7 +188,11 @@ builder.mutationField("requestPasswordReset", (t) =>
|
||||
.set({ password_reset_token: token, password_reset_expiry: expiry })
|
||||
.where(eq(users.id, user[0].id));
|
||||
|
||||
await sendPasswordReset(args.email, token);
|
||||
try {
|
||||
await sendPasswordReset(args.email, token);
|
||||
} catch (e) {
|
||||
console.warn("Failed to send password reset email:", (e as Error).message);
|
||||
}
|
||||
return true;
|
||||
},
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user